I have a project that uses a shared library from another project. In project settings I put the correct include paths and library for the GCC and G++ compiler (-L and -l option). It all compiles well, no problems here. But the source code is not analyzed correctly. My included headerfile (that is located in the other project) is marked as "Unresolved inclusion and everywhere I use something from it, the source is highlighted as well.
#include "myHeader.h"
Any ideas? thanks!
Select C/C++ General -> Path and Symbols. Select Includes tab. In Languages list, select 'GNU C' or whatever C compiler tool chain you use. Press 'Add...' button and add the directory for the include files.
The C/C++ Development Toolkit (CDT) is a set of Eclipse plug-ins that provide C and C++ extensions to the Eclipse workbench. For more information about Eclipse, see Workbench User Guide > Concepts > Workbench. The CDT provides a C/C++ IDE that simplifies many of the same tools that you can use from the command line.
The one that you are missing here (probably) is, telling the indexer where to look for those headers. I normally manage my own Makefile, so I do not know how to make it work for both the eclipse managed makefile and for the Indexer. Probably you will find that the solution below will fix both.
On the solution; right click on the project in the Project explorer ( or resource explorer ), and select Properties. Now under "C/C++ General" > "Paths and Symbols", click on Includes tab and select "GNU C++". Then on the right side, you can add various include paths ( similar to the -I option on gcc/g++ ) by clicking on "Add..." button.
Once you apply and click OK, the indexer will take a while to clear those unresolved object.
A header should be included like this
#include "myHeader.h"
or if it's a standard lib header:
#include <string>
everything else is invalid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With