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源:
[testing-devtools-2-centos-$releasever] |
name=testing 2 devtools for CentOS $releasever |
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
安装:
测试gcc版本:
gcc (GCC) 4.8.1 20130715 (Red Hat 4.8.1-4) |
Copyright (C) 2013 Free Software Foundation, Inc. |
修改环境变量:
gcc (GCC) 4.8.1 20130715 (Red Hat 4.8.1-4) |
Copyright (C) 2013 Free Software Foundation, Inc. |