Search code examples
eclipseeclipse-cdt

How to keep Eclipse CDT from resolving files outside of the configured include path?


I have a project that containst source/header files that are from 3rd party. In my project I have the same filename in a different path (e.g. version.h). The scanner is resolving the includes to the wrong file and therefore fails to parse my source files properly.

That's what I have done:

  • I explicitly configured the project path to not be part of the source path.
  • Third party libraries are not on include path nor on source path (but a still a subfolder in the project).
  • The toolchain is "No ToolChain", as it is a NMAKE project created by CMake.
  • The include directories has been hand selected to exclude not wanted includes and explicitly add wanted includes.

How can I force eclipse to only resolve the files based on the configured include and source pathes?


Solution

  • You can try turning off Allow heuristic resolution of includes. This is a global setting in Preferences -> C/C++ -> Indexer. It can also be overridden per project in the project's settings. Allow heuristic resolution of includes