user4815418
user4815418

Reputation:

Setting Include files and Libraries in Eclipse c++. Still gives error

I have set include directories and library files in Eclipse c++, still I get below error. In my program I have the include directive

#include <xercesc/parsers/XercesDOMParser.hpp>

Error shown - 'fatal error: xercesc/parsers/XercesDOMParser.hpp: No such file or directory' Attached images of how I set include paths and libraries. Am I doing it correctly? Or Am I missing something?

include path image

library image

library paths image

Upvotes: 0

Views: 988

Answers (1)

Jonah Graham
Jonah Graham

Reputation: 7970

You have modified the indexer settings, rather than the build settings. Try changing the settings in C/C++ Build -> Settings instead.

Indexer Settings (in C/C++ General)

These control how CDT highlights code and code completion and various other features of CDT work. The indexer settings inherit the build settings. If you note in your first screenshot there is a "CDT Managed Build Setting Entries" just below where you have added your paths, that is where the setting from the build are populated.

You would normally only need to modify these settings if you have some configuration on your system that CDT cannot automatically detect.

Build Settings (in C/C++ Build)

These control the arguments that are passed to the compiler. In addition, these settings are inherited by the indexer (see above) to handle indexer features.

So for example, if you set build settings for an extra include path like this:

build settings

It is automatically set for you in the indexer settings, see:

inherited

and here:

inherited2

Upvotes: 1

Related Questions