I would like to use c++11 in my Mac system. Could someone show me how to install the compiler of c++11 to use g++ with the option -std=gnu++11 or g++ -std=c++0X in the terminal.
I used :
clang++ -std=gnu++11 test.cpp
but I get the error:
error: invalid value 'gnu++11' in '-std=gnu++11'
Are you using Mavericks, by any chance? Guessing the reason the gnu flags bugger is because gcc in Mavericks actually links to Clang. If you want to use gcc you can install it using Macports or Homebrew.
You have to make sure that the version of compiler you are using supports c++11 with the
-std=c++11 or -std=gnu++11
options. For gcc compilers, you need atleast version (4.7):
g++.exe (GCC) 4.8.1
Copyright (C) 2013 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.
EDIT: It also seems that for you to get clang on your apple product, you need xcode installed (just tried it on a mac air). So if you don't have that already, I suggest you get on it because xcode unlocks the full potential of software development on apple.
edit:
coliru.stacked-crooked probably wont have a download link because like ideone, it is meant to just run the code and return the output to the browser