历史原因用的centos6的机器太多了,但是开发工具包又太旧,升级开发工具包到c++11 还是很简单的。
安装升级工具包源:
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
升级源
yum upgrade
下一步安装 C++11
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++
最后在当前shell启用最新开发工具包
scl enable devtoolset-2 bash
检查gcc版本
# gcc --version gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.