c++11 gcc4.8.x安装
要安装PHP-CPP,需要c++11,否则就会报错,错误信息如下所示:
g++ -Wall -c -g -std=c++11 -fpic -o shared/common/modifiers.o common/modifiers.cpp
cc1plus: error: unrecognized command line option “-std=c++11″
make: *** [shared/common/modifiers.o] Error 1
如果安装c++11 gcc4.8.x呢?请看下面
配置yum源:
# vim /etc/yum.repos.d/devtools-2.repo |
[testing-devtools-2-centos-$releasever] |
name=testing 2 devtools for CentOS $releasever
|
# baseurl=http://puias.princeton.edu/data/puias/DevToolset/$releasever/$basearch/ |
baseurl=http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS |
或是直接从这里下载:http://people.centos.org/tru/devtools-2/devtools-2.repo
或安装http://puias.princeton.edu/data/puias/DevToolset/6/x86_64/devtoolset-2-2.1-4.el6.noarch.rpm
安装:
# yum install devtoolset-2-gcc-4.8.1 devtoolset-2-gcc-c++-4.8.1 devtoolset-2-binutils
|
测试gcc版本:
# /opt/rh/devtoolset-2/root/usr/bin/gcc --version |
gcc (GCC) 4.8.1 20130715 (Red Hat 4.8.1-4) |
Copyright (C) 2013 Free Software Foundation, Inc. |
修改环境变量:
# ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/ |
gcc (GCC) 4.8.1 20130715 (Red Hat 4.8.1-4) |
Copyright (C) 2013 Free Software Foundation, Inc. |