Enable C++11 in Eclipse CDT (Juno/Kepler/Luna) indexer

Nobody moving away from SE picture Nobody moving away from SE · Nov 29, 2012 · Viewed 26.8k times · Source

How do I enable support for the new C++ standard on the Eclipse CDT indexer in Juno/Kepler/Luna?

Answer

Nobody moving away from SE picture Nobody moving away from SE · Nov 29, 2012

Note that this question (and answer) only deals with the Eclipse indexer which is used to highlight errors before compilation takes place. The C++ compiler settings are not changed! (Thus, compilation could still fail because of missing C++11 settings, but have a look at the "Related" section)

To change the Eclipse indexer settings go to Project properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> tab Providers -> CDT GCC Built-in Compiler Settings

and append -std=c++0x (or -std=c++11) to Command to get compiler specs:

Afterwards it should look something like:

${COMMAND} -E -P -v -dD ${INPUTS} -std=c++0x

Screenshot of the configuration pane with the change applied

Sources

Related

Update

Successfully tested with Eclipse

  • Kepler (CDT 8.2)
  • Luna (CDT 8.4)