Search code examples
c++eclipseeditoreclipse-cdt

Why does Eclipse mark pseudo-errors in my source?


I have locally forked (via hg clone) a C/C++ (Eclipse CDT) project and imported it into my Eclipse workspace. My editor window for the forked project now looks like this:

enter image description here

Clearly, these are not real errors, since the code builds correctly. Also, these errors are not marked in the original project from which this one was forked.

Why does Eclipse think there are errors in this source?

EDIT: Eclipse error messages when hovering over the "bugs" are, e.g., Type int64_t could not be resolved and symbol 'cout' could not be resolved.

EDIT: I've noticed that Eclipse usually shows a "folder" named includes in the project. It is missing for this project. How can I get it back?

enter image description here


Solution

  • Eclipse has to know the paths where to find the include files. This may be set using general eclipse settings or project by project.

    For some reason it seems like the default paths are not set for your current project.

    What you can do: Open the project settings and go to C/C++ General -> Paths and Symbols (at least that is how it is called in my eclipse version) and fix the include directories.

    Maybe it is enough to load the default configuration for that specific project. Maybe you have to set up your include pathes by yourself. On Unix / OS X this should usually be usr/include. On Windows I have no idea, but that should be easy to find out.

    Afterwards it may be necessary that your rebuild your eclipse index (right click on your project, then index -> rebuild).

    If that does not help please share a screenshot of the Paths and Symbols dialog of your project.

    Also see the eclipse documentation on this topic.