Clang ++ doesn't understand C ++ 11 on mac terminal

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!

+5
source share
2 answers

As Andy said, your compiler only accepts -std=c++0x. He's probably pretty old.

[Answer only to remove the question from the unanswered queue]

+1
source

, , , Xcode , clang , ++ g++ mac osx . xcode , gcc (4.2.1). gcc http://hpc.sourceforge.net (4.8.1). . g++ -std=c++11 .

0

All Articles