Linked resources, header files and includes paths [message #1767509] |
Thu, 06 July 2017 15:27 |
Alex Bb Messages: 7 Registered: September 2016 |
Junior Member |
|
|
Hi,
I'm experimenting linked resources but when header files get involved it seems to become pretty confusing..
I have 2 projects in Eclipse neon, let say A and B.
A is the main project, it uses an external makefile for build and that projects builds successfully.
Second project B, in the same workspace, is made of B-private files and some C and H files belonging to project A.
I use linked resource to "add" in project B source files from project A.
For C source files, this is OK, works fine.
For H source files, I add one H file as a linked resource in my project B. But that file cannot be found by gcc (No such file or directory) - unlike other B-private H files.
It seems that linked files are not visible to the project even when they are located in a valid folder (where others H files are properly included).
Are there some specific rules to get linked header files properly included in a project ?
Thanks in advance for any hint,
Alex
|
|
|
|
Re: Linked resources, header files and includes paths [message #1767615 is a reply to message #1767573] |
Fri, 07 July 2017 15:34 |
Alex Bb Messages: 7 Registered: September 2016 |
Junior Member |
|
|
Hello,
Yes, I also have no problem at using linked folder, just need to add them in the search path of the preprocessor.
Note sure what can I provide exactly from my project. What I can add at least is:
- Eclipse neon runs on Ubuntu 16.04
- When building Project B (helloPiShell), here the output:
23:50:06 **** Incremental Build of configuration Debug for project helloPiShell ****
make all
Building file: ../HelloW.c
Invoking: GCC C Compiler
gcc -I"/home/alex/workspace/helloPiShell" -I"/home/alex/workspace/essProcMode/inc" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"HelloW.d" -MT"HelloW.o" -o "HelloW.o" "../HelloW.c"
../HelloW.c:13:22: fatal error: keyboard.h: No such file or directory
compilation terminated.
make: *** [HelloW.o] Error 1
subdir.mk:18: recipe for target 'HelloW.o' failed
23:50:06 Build Finished (took 249ms)
- -I arguments show 1/ the local include path and 2/ the linked folder path in A project (essProcMode). Files there are all found perfectly.
- keyboard.h is located in B project main folder (not linked) "/home/alex/workspace/essProcMode". I don't think I have to set this path in the B project's search path - otherwise why using links ?
- I'm suprised to see HelloW.c included from ../. instead of just ./. . Seems the build is run from debur or release folder ?
- In Eclispe outline view, all files are perfectly found and can be display by just a doubleclick, local or linked files. Seems then Eclipse and the builder do not have the same 'search paths'
Not sure what else can I add or try ...
Thanks
[Updated on: Fri, 07 July 2017 15:35] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03466 seconds