Issue
I am developing C+11 code in Eclipse Neon and noticed today that the range based for loop introduced in C+11 is highlighted red by the IDE indicating it does not recognize it.
I have found multiple links about how to do this for older versions of CDT such as this (Eclipse CDT C++11/C++0x support) You can see though there is no "Tool Settings" tab.
Can someone suggest how to configure my project so that C++11 syntax is correctly highlighted (I am using a separate build system)
Solution
- Right click on your project and click Properties
- Navigate to C/C++ General and Preprocessor Include Paths, Macros etc.
- Select the Providers tab, click on compiler settings row for the compiler you use.
- Add -std=c++11 to Command to get compiler specs.
- Apply changes.
Will look something like this:
${COMMAND} -E -P -v -dD "${INPUTS}" -std=c++11
Answered By - Andreas DM