【问题标题】:cc1plus: error: unrecognized command line option "-std=c++11"cc1plus:错误:无法识别的命令行选项“-std=c++11”
【发布时间】:2015-02-05 03:22:43
【问题描述】:

我正在尝试在 centos 6,5 上安装 php-cpp。 当我运行命令 make 时,我收到错误:

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.

非常感谢!

=== 更新 ====

修复了将 gcc 从 4.4 升级到 4.7

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

【问题讨论】:

标签: centos g++ php-cpp


【解决方案1】:

直到 g++ (4.7) 的更高版本才添加该标志,以获取 gcc 4.4 兼容(尽可能多),您需要使用 -std=c++0x 标志。

参考:https://gcc.gnu.org/projects/cxx0x.html

【讨论】:

猜你喜欢
  • 2016-08-09
  • 2015-11-12
  • 2013-01-18
  • 1970-01-01
  • 2016-02-10
  • 2017-01-22
  • 2016-06-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多