c++ - Multiple "could not be resolved" problems using Eclipse with minGW

ID : 274312

viewed : 36

Tags : c++eclipsegccc++11mingw32c++





Top 4 Answer for c++ - Multiple "could not be resolved" problems using Eclipse with minGW

vote vote

96

Go to Project -> Properties -> C/C++ General -> Preprocessor Include Paths, Macros, etc. -> Providers -> CDT GCC built-in compiler settings, deactivate Use global provider shared between projects and add the command line argument -std=c++11.

The eclipse live code analysis does not share the same settings with the build compiler. You can also change the setting globally (not just for the project) in Window -> Preferences -> C/C++ -> Build -> Settings -> CDT GCC Built-in Compiler Settings.

Edit: You need to #include <string> to use std::to_string.

vote vote

85

I'm adding a few details to the answers given by @Nabla and @Enissey.

When adding the command line argument, for example, CDT GCC Built-in Compiler Settings Cygwin in Global preferences,

${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}" 

do it like so,

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

To rebuild the index, right-click on your project, go under the Index sub-menu, and choose "Rebuild."

In my case, I made the changes globally and rebuilt the index.

vote vote

74

Re download the gcc compiler from:

http://www.equation.com/servlet/equation.cmd?fa=fortran 

install it in c:\minGW folder use new worksapce / fresh eclipse setting , it work like a charm!

Don't forget to restart before trying , re build and set etc.

as well to set MinGW as a default tool chain windows -> preferences -> New C++.. ->set MinMG as a tool chain preferred.

If you cannot see it on the list , deselect the "show project types...." as well when creating the project.

vote vote

69

Top 3 video Explaining c++ - Multiple "could not be resolved" problems using Eclipse with minGW







Related QUESTION?