Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » -std=c++0x no more works on OS X 10.8(After upgrade from 10.6 to 10.8, it doesn't works.)
icon5.gif  -std=c++0x no more works on OS X 10.8 [message #902327] Fri, 17 August 2012 05:59 Go to next message
kao hong-jen is currently offline 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

Re: -std=c++0x no more works on OS X 10.8 [message #902335 is a reply to message #902327] Fri, 17 August 2012 06:59 Go to previous message
kao hong-jen is currently offline kao hong-jen
Messages: 2
Registered: August 2012
Junior Member
I found a temporary solution:
Project->properties->C/C++ Build->Settings->Tool Settings->Mac OS X C++ Linker -> Command
change from 'g++' to '/opt/local/bin/g++'
Project->properties->C/C++ Build->Settings->Tool Settings->Mac OS X C++ Compiler -> Command
change from 'g++' to '/opt/local/bin/g++'
Previous Topic:Please suggest me how to download and build Eclipse Juno source code
Next Topic:console input during debugging?
Goto Forum:
  


Current Time: Thu Oct 23 03:17:11 GMT 2014

Powered by FUDForum. Page generated in 0.05608 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software