2014-12-07 196 views
5

我想在centos 6.5上安裝php-cpp。 當我運行make命令,我得到錯誤:cc1plus:錯誤:無法識別的命令行選項「-std = C++ 11」

make: Warning: File `Makefile' has modification time 5.1e+05 s in the future 
mkdir -p shared/common 
mkdir -p shared/zend 
mkdir -p shared/hhvm 
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 

我應該爲修復此做什麼? 我的g ++是:

g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) 
Copyright (C) 2010 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. 

非常感謝!

=== UPDATE ====

與升級GCC修正從4.4到4.7

http://ask.xmodulo.com/upgrade-gcc-centos.html

+0

https://stackoverflow.com/questions/14674597/cc1plus-error-unrecognized-command-line-option-std-c11-with-g – otiai10 2018-02-23 08:45:37

回答

8

不添加標誌,直到g++(4.7)更高版本,以獲得gcc 4.4 compat(和那裏一樣多),你需要使用-std=c++0x標誌。

編號:https://gcc.gnu.org/projects/cxx0x.html

+0

太謝謝你了。我使用流行的http://ask.xmodulo.com/upgrade-gcc-centos.html將g ++升級到4.7 – 2014-12-08 01:48:07

相關問題