版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1338387
本文内容
由于服务器权限各种问题需要定制gcc开发环境,问题如下:
version `CXXABI_1.3.8’ not found (required by …)这个错误,
这个标志位至少GCC 4.9以上(这个问题安装gcc 4.9以上的版本即可)。
由于不能覆盖系统的gcc所以需要自己$HOME目录下面源码安装gcc
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_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
转载注明出处哈