Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse CrossCompile include issues(Includes issues unresolved dependency )
Eclipse CrossCompile include issues [message #1792692] Sun, 22 July 2018 05:55 Go to next message
Rob CR is currently offline Rob CRFriend
Messages: 1
Registered: July 2018
Junior Member
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 project 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. Let's say your setting up a new project what are the default includes. Also should I be using the project type Make instead of just selecting a C/C++ project. Is this a system path issue?

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

Source Location:
'my project location'

Output Location:
This is the location where Debug or Release will be placing the output of the build.
Re: Eclipse CrossCompile include issues [message #1792843 is a reply to message #1792692] Wed, 25 July 2018 03:29 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Perhaps the problem is using the LInaro toolchain but your system header files were designed for GCC?


Does the Linaro toolchain allow finding the system files?
The GCC builtins provider in
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Providers tab
has ${COMMAND} -std=c++11 ${FLAGS} -E -P -v -dD "${INPUTS}"
Your toolchain might have similar capabilities.
In addition to system header file paths (there are a lot more than /usr/include), there are many macro definitions.
These are used in the header files.

Also:
Boost, in particular, is not completely header only.
boost/filesystem is one of these (or once was) and needs (or did need) BOOST_ALL_DYN_LINK.
It's doubtful that dynamic link libraries built for x86 processors running linux will work in your ARM.
You probably will need to compile them specifically for your target processor.

---

That said, you shouldn't need to add every subdir in /usr/include/boost.
In fact, you shouldn't need to add /usr/include/boost if you have /usr/include.

Maybe all you need is to rebuild the index.

You may need to generate a parser log: Project --> C/C++ Index --> Create Parser Log File
Reading one is tedious but may offer a clue as to why the indexer can't find the headers.

Try changing the toolchain to GCC and see if the problem persists.
If that fixes it then maybe you can use the GCC builtins provider.

FYI: The indexer uses Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
You will need the Managed Build Setting provider to copy the the entries in Paths and Symbols to the Discovery page.
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Providers tab --> CDT Managed Build Setting Entries
Sounds like it's already enabled.

[Updated on: Wed, 25 July 2018 03:51]

Report message to a moderator

Previous Topic:Unexpected file linking
Next Topic:How To Save Build Configuration
Goto Forum:
  


Current Time: Fri Apr 19 15:48:12 GMT 2024

Powered by FUDForum. Page generated in 0.02454 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top