Eclipse 3.7.1 CDT 1.4.1 GCC 4.6.2
This is an example of a piece of C++11 code:
auto text = std::unique_ptr(new char[len]);
Update 2016:
As of gcc 6 (changes), the default C++ dialect is C++14. That means that unless you explicitly need a newer or older dialect than than, you don't need to do anything with eclipse anymore.
This community wiki section incorporates the answer by Trismegistos;
1. Before creating project, configure Eclipse syntax parser:
Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build-in Compiler Settings
in the text box entitled Command to get compiler specs append -std=c++14
2. Create project, configuration depends on what kind of project you created:
For project created as: File -> New -> Project -> C/C++ -> C++ Project
Right click on created project and open
Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Dialect
Put -std=c++14
into text box entitled other dialect flags or select ISO C++11 from the Language standard drop down.
For most recent versions: (Currently Juno and Kepler Luna):
Under newer versions of Juno the settings are located at Project properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> tab Providers -> CDT GCC Builtin Compiler Settings ()
.
Older versions 2012/2013:
Under C/C++ Build (at project settings), find the Preprocessor Include Path and go to the Providers Tab. Deselect all except CDT GCC Builtin Compiler Settings. Then untag Share settings entries … . Add the option -std=c++11 to the text box called Command to get compiler specs.
Go to paths and symbols. Under Symbols, click restore defaults, and then apply.
Notes:
Eclipse is picky about hitting apply, you need to do it every time you leave a settings tab.
[Self-promotion]: I wrote my own more detailed instructions based on the above. http://scrupulousabstractions.tumblr.com/post/36441490955/eclipse-mingw-builds
Thanks to the user Nobody
at https://stackoverflow.com/a/13635080/1149664