6

i am trying install php-cpp on centos 6,5. when i run command make, i am getting 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 i should to do for fix this? my g++ is:

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 so much!

=== UPDATE ====

Fixed with upgrade gcc from 4.4 to 4.7

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

Mr Jerry
  • 1,686
  • 3
  • 14
  • 22
  • https://stackoverflow.com/questions/14674597/cc1plus-error-unrecognized-command-line-option-std-c11-with-g – otiai10 Feb 23 '18 at 08:45

1 Answers1

9

That flag was not added until a later version of g++ (4.7) to get the gcc 4.4 compat (as much as was there) you need to use the -std=c++0x flag.

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

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
  • Thank you so much. i upgraded g++ to 4.7 with flowed http://ask.xmodulo.com/upgrade-gcc-centos.html – Mr Jerry Dec 08 '14 at 01:48