-std=c++0x no more works on OS X 10.8 [message #902327] |
Fri, 17 August 2012 05:59 |
kao hong-jen Messages: 2 Registered: August 2012 |
Junior Member |
|
|
Hello everyone:
When my OS is still 10.6 Snow Leopard, I can add -std=c++0x on GNU C++ Compiler's Miscellaneous flag and it works fine.
But after upgrade to 10.8, eclipse CDT complain to me:
cc1plus: error: unrecognized command line option "-std=c++0x"
However, I use terminal and cd to myprog/Debug and enter 'make', there's no complain.
I think that's because eclipse CDT doesn't find g++ from $PATH, but use Xcode's default compiler.
However, OS X 10.8 change Xcode's default compiler to llvm-gcc (4.2), which is not support C++11.
I verify this assumption by using 'g++ --version':
$ g++ --version
g++ (GCC) 4.7.0
Copyright (C) 2012 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.
$ /Applications/Xcode.app/Contents/Developer/usr/bin/g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 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.
Now back to eclipse, choose
Project->properties->C/C++ Build->Settings->Build Steps->Post-build Steps->Command
enter 'g++ --version'.
Now build and run, see console output. It shows
make --no-print-directory post-build
g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 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.
So I want to ask: how can I let eclipse CDT use g++4.7?
I tried change Project->properties->C/C++ Build->Tool Chain Editor, doesn't work.
[Updated on: Fri, 17 August 2012 06:00] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03853 seconds