Eclipse CrossCompile include issues

Hi everyone, I need help and sorry for the long read but I'm not sure what to call what I'm experiencing and just want to be thorough

I have Ubuntu 16 with photon eclipse to cross compile for Arm using the Linaro toolchain. My hello world project compiles and runs correctly. But when I try to include files that have additional files nested within it's location I get unresolved include errors. The project type I selected was C/C++ project (should I be using make instead?)

For example:
'#include boost/filesystem.hpp' - results in unresolved include because filesystem.hpp contains '#include boost/filesystem/config.hpp' which is a file that is nested inside it's root directory boost '/usr/include/boost/filesystem/'
But in eclipse even with the unresolved I can use 'F3' and open the file from the #include line. Just to be clear this is not just happening with boost it's happening with any source folder that contains source or headers within nested folders. Even though the include line has the relative path to the file.

The only way I have found to resolve this is to add every nested folder to the C/C++ General -> Paths and Symbols - Includes Tab. This means any include file that is in '/usr/include' works but if it's located in '/usr/include/somedirectory' it fails until I add '/usr/include/somedirectory' to the Paths and Symbols - Includes Tab. Which also means if it has 10 folders nested then each of the 10 must be added to Paths and Symbols.


I'm sure I have eclipse setup incorrect but with a lack of experience I'm not sure how to correct it. The part I'm lost at is if I have '/usr/include' added to Paths and Symbols includes. Then in my source or header add '#include boost/filesystem.hpp' it fails. Shouldn't that work since it contains the relative path with the include statement? To fix it I also have to add '/usr/include/boost' to the Paths and Symbols includes.


In Eclipse Paths and Symbols what is the correct way to setup the Includes, Libraries, Library Paths, Source Location and Output Location tabs.

Includes:
/usr/includes/boost
or should I just use /usr/include ?
'root directory to source or headers I use'

Source Location:
'my project location'

Output Location:
This is the location where Debug or Release will be placing the output of the build.



Last edited on
But in eclipse even with the unresolved I can use 'F3' and open the file from the #include line


The IDE and the compiler are completely different. Your IDE knowing where to find a file has zero bearing on your compiler knowing where to find the file. They are completely different programs.

Give us a practical example. Show us the command line being used to call the compiler (which will have the include directories it is being told to look in) and the location of the first include file it can't find.
Last edited on
Topic archived. No new replies allowed.