Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Guide to Eclipse with C++11 standard(For Ease of Reference)
Guide to Eclipse with C++11 standard [message #787571] Tue, 31 January 2012 18:37 Go to next message
Robert Pavel is currently offline Robert PavelFriend
Messages: 3
Registered: August 2010
Junior Member
Figured it would be worth making a thread for people who, like me, are trying to get the Eclipse support for the C++11 (previously known as C++0x) standard. Currently the info is spread out over a few threads, but I didn't find an easy centralized location. As with most computer-related help forums on the internet, people don't come back once they have a solution.

After a bit of research and fiddling, the following steps seem to work (if someone more knowledgeable wants to correct me, feel free).

This is for Eclipse Indigo with CDT 8.0.1.
Standard Project

  • Make a new C++ project (currently I have only tested "Empty Project -> Linux GCC". Others can verify on non-Linux platforms)
  • Default options for everything
  • Once created, right-click the project and go to "Properties"
  • C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags. Put "-std=c++0x" at the end
  • C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste "__GXX_EXPERIMENTAL_CXX0X__" into "Name" and leave "Value" blank.
  • Hit Apply, do whatever it asks you to do, then hit OK.



Makefile Project

  • Make a new empty Makefile project (or import an old one)
  • Default options for everything
  • Once created, right-click the project and go to "Properties"
  • C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste "__GXX_EXPERIMENTAL_CXX0X__" into "Name" and leave "Value" blank.
  • Hit Apply, do whatever it asks you to do, then hit OK.
  • Obviously make sure your rule includes "-std=c++0x" as a compiler option.


And everything should be functional (based on limited testing). At the very least,
I got a few examples to compile, which is enough for me to start development. Syntax highlighting works, and so does building.

[Updated on: Tue, 31 January 2012 19:20]

Report message to a moderator

Re: Guide to Eclipse with C++11 standard [message #788041 is a reply to message #787571] Wed, 01 February 2012 09:25 Go to previous messageGo to next message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
Thanks from the community !
Re: Guide to Eclipse with C++11 standard [message #792006 is a reply to message #787571] Mon, 06 February 2012 13:59 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste "__GXX_EXPERIMENTAL_CXX0X__" into "Name" and leave "Value" blank.

Instead of this you should add the option -std=c++0x to the scanner discovery in Project Properties->C/C++ Build ->Discovery Options in the field "compiler invocation arguments". This way Eclipse (or better said the compiler) will find automatically the correct includes and __GXX_EXPERIMENTAL_CXX0X__ is automatically defined.


BTW, could you please add your instructions to the CDT FAQ http://wiki.eclipse.org/CDT/User/FAQ


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Guide to Eclipse with C++11 standard [message #792013 is a reply to message #792006] Mon, 06 February 2012 14:06 Go to previous messageGo to next message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
As my project is described with a CMake file, I have to declare it as C++11 each time the project is updated (because I then reimport the project as a makefile project).
Woudl it be possible to set that once ?
Re: Guide to Eclipse with C++11 standard [message #792796 is a reply to message #792013] Tue, 07 February 2012 12:23 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Oodini Mising name wrote on Mon, 06 February 2012 15:06
As my project is described with a CMake file, I have to declare it as C++11 each time the project is updated (because I then reimport the project as a makefile project).
Woudl it be possible to set that once ?

In Windows->Preferences->C/C++->New CDT project wizard->Makefile project you can set options for the discovery
Enable "Automate discovery" use "GCC per project scanner" as Discovery profile.

I never used this option so I would be happy about your feedback.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Guide to Eclipse with C++11 standard [message #1221471 is a reply to message #787571] Tue, 17 December 2013 19:43 Go to previous message
Vivian Pitts is currently offline Vivian PittsFriend
Messages: 1
Registered: December 2013
Junior Member
I do not understand how to update the Makefile -> Obviously make sure your rule includes "-std=c++0x" as a compiler option.

I created the Makefile project with existing code. However, I do not see a file to update the Makefile.

How do I update the Makefile. The error I receive now is make: *** No rule to make target `all'. Stop.

Previous Topic:Complete help files for creating a custom project creation wizard
Next Topic:Eclipse C++ settings for MAC OSX
Goto Forum:
  


Current Time: Tue Apr 23 07:26:00 GMT 2024

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

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

Back to the top