Cc1plus: error: unrecognized command line option "-std = C ++ 11"

I am trying to install php-cpp on centos 6.5. when I run the make command, I get an error:

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 

What should I do to fix this? my 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. 

Thank you very much!

=== UPDATE ====

Fixed updating gcc from 4.4 to 4.7

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

+5
source share
1 answer

This flag was not added until a later version of g++ (4.7), in order to get compatibility with gcc 4.4 (as many as there were), you need to use the -std=c++0x flag.

Link: https://gcc.gnu.org/projects/cxx0x.html

+8
source

Source: https://habr.com/ru/post/1208520/


All Articles