Chungzuwalla
Chungzuwalla

Reputation: 1068

Eclipse CDT with MinGW: indexer can't find standard headers

I'm using Eclipse Oxygen CDT on Windows 7 64-bit. I've got MinGW-W64 installed, in a non-standard location but Eclipse reports that it is correctly found. But in the project I'm working on (which is a plain Makefile project), lines like

#include <string.h>

are underlined and marked with a '?' in the margin. I believe the component responsible is the "indexer".

I can solve the problem by adding the MinGW include path to each project (Properties -> C/C++ General -> Paths and Symbols), but that seems like The Wrong Way To Do It, as I'd have to repeat for every new project.

There doesn't seem to be a global setting though -- nothing in Preferences -> C/C++ -> Indexer, and nothing similar to 'Paths and Symbols' in global preferences.

Can I set the include paths used by the indexer once, so that any project using MinGW will "inherit" them?

Upvotes: 2

Views: 809

Answers (1)

Chungzuwalla
Chungzuwalla

Reputation: 1068

OK, well I've found what worked for me. I went to:

Project Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc.

And selected the Providers tab. An entry "CDT GCC Built-in Compiler Settings MinGW" was present, but was not checked. I checked this and ensured "Use global provider shared between projects" was checked. Hit Apply, and every project was magically re-indexed and the headers are now found.

Thanks are due to @HighCommander4's comment which prompted me to poke around the settings a bit more.

Upvotes: 5

Related Questions