Eclipse CDT indexer does not know C++11 containers

Setting up **__GXX_EXPERIMENTAL_CXX0X__** does not help in my case (Jul 2014, Eclipse Kepler 20130919, Ubuntu 12.04).

To fix C++11 syntax highlighting go to:

Project Properties --> C/C++ General --> Paths and Symbols --> Symbols --> GNU C++

and overwrite the symbol (i.e. add new symbol):

__cplusplus

with value

201103L

UPDATED: If you use newer version of Eclispe (as of 2016) and still experience the same problem, try value (as pointed by jose.diego):

201402L

Make sure that indexer is enabled in Project settings (C/C++ general --> Indexer)

Then reindex (Project --> C/C++ Index --> Rebuild)

if the problem still persist reindex once again. It should work now.


I solved this problem recently after some lucky googling.

Click on your project and right-click->Properties

Select "C/C++ General -> Processor Include Paths, Macros etc..."

Select the "Providers" tab

Deselect everything except "CDT User Setting Entries" and "CDT GCC Built-in Compiler Settings"

Click on "CDT GCC Built-in Compiler Settings"

Deselect "Use global provider shared between projects"

Edit the box at the bottom labeled "Command to get compiler specs"

Insert into the command -std=c++11 so it looks something like this:

${COMMAND} -std=c++11 -E -P -v -dD "${INPUTS}"

Click Apply and Okay.

enter image description here

That worked for me. You probably need to re-index the project.


As described in this forum post:

http://www.eclipse.org/forums/index.php/mv/msg/282618/

  • 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.