Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g++ wont compile std=c++0x under Snow Leopard

Having an old Intel Core Duo MacBook with Snow Leopard, when I try to compile using g++ and the input parameter std=c++0x I get:

cc1plus: error: unrecognized command line option "-std=c++0x"

Any ideas of how to fix this?

like image 727
Smajjk Avatar asked Oct 09 '12 07:10

Smajjk


1 Answers

c++0x / c++11 support has only been added starting with gcc v4.3, see this page to check what c++ feature has been added in what gcc version.

Alternatively you could use the clang++ compiler, which also comes standard with XCode. See this page for version info.

Or install gcc47 from macports

Btw, better use -std=c++11, the c++0x option is not supported by clang.

like image 180
Willem Hengeveld Avatar answered Nov 13 '22 17:11

Willem Hengeveld