2022-07-20 05:22 AM
We're working on a projekt with different µC and some so called "Common-Modules".
These commons are located side by side our projects and shall simply been linked to these.
All this could be done, but on building the project, we noticed, that no modules were built, if the include pathes were relative to the project file. Only if the path is given as an absolute path (for example like "C:\work\thiswork\module1\...") the compilation will be successfull.
As the projects will be built local and on a remote server too, absolute paths are no choice for us.
Are there any solutions to solve this?
Best Regards
Solved! Go to Solution.
2022-07-20 09:35 AM
> we noticed, that no modules were built, if the include pathes were relative to the project file.
Of course this does work. A lot of people rely on this. Do you use the standard Eclipse CDT macros, such as ${ProjDirPath} ?
2022-07-20 06:45 AM
"if the include pathes were relative to the project file"
Presumably, then, they need to be relative to something else.
"These commons are located side by side our projects"
You could simply avoid the issue completely by having these commons within your projects.
That's the way I'd do it - for this very reason.
2022-07-20 09:35 AM
> we noticed, that no modules were built, if the include pathes were relative to the project file.
Of course this does work. A lot of people rely on this. Do you use the standard Eclipse CDT macros, such as ${ProjDirPath} ?
2022-07-20 09:49 AM
@Pavel A. "Do you use the standard Eclipse CDT macros, such as ${ProjDirPath} ?"
Does that work for making a relative path and/or to something not in or below the Project Directory?
2022-07-20 10:12 AM
@Andrew Neil ${ProjDirPath} is substituted to absolute path on the build machine, so it is not relative, strictly speaking.
From there you can step out, for example ${ProjDirPath}/../
This is portable to Linux; Eclipse will automatically use correct slashes.
One can also use workspace based paths, if names of other projects included into the workspace are known.
2022-07-21 03:05 AM
We tried to step from the actual project like "\..\..\common", but this didn't work.
Using the macros did the trick, thanks a lot.
Regards
2022-07-21 03:13 AM
@K2R "Using the macros did the trick"
Good to hear - now please mark the solution: