centos6.8自带gcc版本太低为4.4.7,要通过自行编译进行升级。
1.主要流程
参见:
http://www.cjjjs.com/paper/czxt/2017222114137150.aspx
2.错误处理
2.1需要安装c++编译器
configure: error: C++ compiler missing or inoperational
make[2]: \*** [configure-stage1-libcpp] Error 1
make[2]: Leaving directory `/home/liukk/gcc-4.8.1'
make[1]: \*** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/liukk/gcc-4.8.1'
make: \*** [all] Error 2
需要安装c++的编译器
yum install gcc-c++
2.2升级gcc4.8 遇到 fatal error: gnu/stubs-32.h: No such file or directory 问题的解决方法
注意在configure时加上 -disable-multilib选项或 sudo yum install glibc-devel.i686 libstdc++-devel.i686
参考:https://www.douban.com/note/543322671/
../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib