缘由:
centos 6 比较保守,yum 库中的 gcc 版本只到 4.4.7,而该版本的 g++ 不支持 c++11,而我在编译 vim 的插件 YouCompleteMe 的时候要用到 c++11,而且自己写代码也经常要用到 c++11 的特性,所以决定编一个出来(网上有一个 yum 源,但是已经不能用了)
链接:
- 编译步骤:
- https://itbilu.com/linux/management/V1vdnt9ll.html
- http://blog.csdn.net/u012317833/article/details/24344019
- 最好是找一下合适的 configure 参数
- 编译过程中碰到的错误解决方法
- 内存不足(g++: 内部错误:Killed (程序 cc1plus)):http://tianshuai.github.io/blog/2013/08/26/g-plus-plus-internal-error-killed-program-cc1plus/
- 编译 c++11 程序时报错:/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
https://itbilu.com/linux/management/NymXRUieg.html
其它
- 给虚拟机分配了 2 核 cpu,4G 内存也还是编了(一个多钟)
- 安装 g++ 指令:yum -y install gcc-c++
- YouCompleteMe 的编译脚本还是找 /usr/bin/gcc 提示版本低了,索性直接删了低版本的 gcc。。
- 编译 YouCompleteMe 需要依赖 python-devel
- 编译 binutils、glibc、gcc:http://www.linuxfromscratch.org/lfs/view/development/index.html
- 为了在 centos 6 上编一个 YouCompleteMe 编这么多东西,我也是醉了。。