Search code examples
ceclipseeclipse-cdt

How can I add specific header file to index as if it was included in eclipse cdt?


I am working in ffreestanding environment (custom make builder, which works fine), but indexer seems to have trouble with default gcc includes that you can query by

gcc -dM -E - < /dev/null

which I really need, so I exported them to header but I don't want to include it, is there a way to make indexer take that file as "included" everywhere (because it really is).

I have eclipse cdt 8.8.0


Solution

  • CDT has a mechanism to discover the compiler's built-in include paths and defines, called the Built-in Compiler Settings provider.

    This provider is configured in Project Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers tab -> CDT GCC Built-in Compiler Settings.

    Make sure this provider is enabled, and adjust the "Command to get compiler specs" as appropriate, and CDT should start picking up the compiler's built-in settings.