个人学习笔记,谢绝转载!!!
原文:https://www.cnblogs.com/wshenjin/p/14523992.html
# wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.1/gcc-4.8.1.tar.bz2
# tar xf gcc-4.8.1.tar.bz2
# ./contrib/download_prerequisites
# cd gcc-4.8.1
# mkdir gcc-build
# cd gcc-build/
# ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib --prefix=/usr/local/gcc-4.8.1
# make -j8
# make install
# ln -sv /usr/local/gcc-4.8.1/bin/* /usr/local/bin/
# export CC=/usr/local/bin/gcc
# export CXX=/usr/local/bin/g++
# export LD_LIBRARY_PATH=/usr/local/gcc-4.8.1/lib/:$LD_LIBRARY_PATH
# mkdir -p /usr/lib64/gcc-4.8.1/
# ln -sv /usr/local/gcc-4.8.1/lib64/libstdc++.so.6.0.18 /usr/lib64/gcc-4.8.1/libstdc++.so.6
# ln -sv /usr/local/gcc-4.8.1/lib64/libstdc++.so.6.0.18 /usr/lib64/gcc-4.8.1/libstdc++.so
# cat > /etc/ld.so.conf.d/gcc-4.8.1.conf << EOF
/usr/lib64/gcc-4.8.1/
EOF
# ldconfg