前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ubuntu gcc(4.6/5.2)源码安装(version `CXXABI_1.3.8' not found)

ubuntu gcc(4.6/5.2)源码安装(version `CXXABI_1.3.8' not found)

作者头像
bear_fish
发布2018-09-14 10:06:06
2.2K0
发布2018-09-14 10:06:06
举报

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1338387

本文内容

  • version `CXXABI_1.3.8’ not found (required by …)
  • gcc源码安装,到指定目录

由于服务器权限各种问题需要定制gcc开发环境,问题如下:

  1. 工作需要使用其他部门的C++SDK,他们有自己的编译服务器,但是代码保密原因不能给我服务器权限
  2. 代码需要上传到他们制定的服务器上面运行,但是不能修改任何于是需要自己源码安装gcc到自己的用户目录下

version `CXXABI_1.3.8’ not found (required by …)这个错误,

这个标志位至少GCC 4.9以上(这个问题安装gcc 4.9以上的版本即可)。

由于不能覆盖系统的gcc所以需要自己$HOME目录下面源码安装gcc

  1. 下载gcc tar gz 例如gcc 5.2
  2. 最好看下官网的安装介绍,我由于没看第一次就安装失败了:configure的时候没有在外层目录

Many people rush into trying to build GCC without reading the installation docs properly and make one or more of these common mistakes: do not run ./configure from within the source directory, this is not supported. You need to run configure from outside the source directory, in a separate directory created for the build (this is a FAQ)

代码语言:javascript
复制
tar xzf gcc-4.6.2.tar.gz  #your's own version(tar xzf gcc-5.2.0.tar.gz)
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=$HOME/GCC-4.6.2 --enable-languages=c,c++,fortran,go
make  #(for fast install you can use make -j8, start 8 threads)
make install    

如果出现

加上–disable-multilib ,由于没有使用go什么的就没要了

./configure –prefix=/home/xiongyu/gcc_5_2_install/–enable-languages=c,c++ –disable-multilib

如果出现下面的错误:

/home/xiongyu/gcc_5_2_install/objdir/../gcc-5.2.0/gcc/lto/lto.c:3515:0: ./gt-lto-lto.h:156:2: fatal error: error writing to /tmp/ccV6nK3Y.s: No space left on device

mkdir ~/tmp

export TMPDIR=~/tmp

换一个tmp目录

编译安装完成之后加入到环境变量(记得下面的目录为你自己的目录)

export LD_LIBRARY_PATH=/home/user/lib/gcc-5.2.0/lib:$LD_LIBRARY_PATH

转载注明出处哈

http://blog.csdn.net/haluoluo211/article/details/77720913

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年08月30日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档