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

来源:互联网 发布:证券分析师 知乎 编辑:程序博客网 时间:2024/06/05 21:09

本文内容

  • 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)

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_prerequisitescd ..mkdir objdircd objdir$PWD/../gcc-4.6.2/configure --prefix=$HOME/GCC-4.6.2 --enable-languages=c,c++,fortran,gomake  #(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

阅读全文
0 0
原创粉丝点击