I am trying to get C ++ code (with C ++ 11) to compile in a mac terminal. I tried
clang++ -std=c++11 main.cpp
but i get an error
error: invalid value 'c++11' in '-std=c++11'
My xcode is completely updated, I assume I am doing something wrong in the terminal? The code works fine in the xcode code itself, I just can't get it to work in the terminal. Any tips would be great!
As Andy said, your compiler only accepts -std=c++0x. He's probably pretty old.
-std=c++0x
[Answer only to remove the question from the unanswered queue]
, , , Xcode , clang , ++ g++ mac osx . xcode , gcc (4.2.1). gcc http://hpc.sourceforge.net (4.8.1). . g++ -std=c++11 .
g++ -std=c++11