cc1plus:错误:无法识别的命令行选项"-std = c ++ 11"

 ICE丶Remiges 发布于 2022-12-07 14:11

我正在尝试在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

1 个回答
  • 直到后来的版本g++(4.7)才能获得该标志,以获得gcc 4.4 compat(就像那里一样)你需要使用该-std=c++0x标志.

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

    2022-12-11 02:14 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有