I wanted to compile C++11 source code within Mac Terminal but failed. I tried g++ -std=c++11
, g++ -std=c++0x
, g++ -std=gnu++11
and g++ -std=gnu++0x
but nothing worked. Terminal always read unrecognized command line option
. However, g++ -std=gnu
and things like that worked fine (of course C++11 source code could not pass).
Which option should I use to turn on C++11 support?
By the way, the command line tool I'm using is installed within Xcode, and I'm pretty sure that they are up-to-date.