Exe project builds dependent libs in lib current config, not exe config [message #1782480] |
Fri, 23 February 2018 16:50  |
Eclipse User |
|
|
|
Hi,
I have a workspace with 2 projects, an exe and a shared library.
The exe is set up with a project reference to the library project, and lists the library and library search path under C/C++ General under GNU ARM Cross C Linker->Libraries. The library search path is set to use "$(workspace_loc:/mylib/$(ConfigName))" - this is so that when building the Release mode exe, it links with the Release mode lib, and vice versa.
If both exe and lib project are both set manually to the same build config, say both in Release mode, all works well - starting clean, building the exe will build the dependent lib, and it links.
But if I change the exe build config say from Release to Debug, but do not also do the same for the lib project build config, it fails to link. What happens after a clean in this situation is the exe knows to build the dependent lib, but it builds the lib in Release mode (the currently Active mode for the lib project) - not Debug mode which is what the exe project is currently building in and Active. And then it fails to link because the expected mode lib output file is not there.
This seems pretty basic for an IDE - when building an app with a dependent lib, the Release/Debug mode of the app should also be the same mode used to rebuild the dependent lib. How to accomplish this?
Thanks,
Rick
|
|
|
|
Re: Exe project builds dependent libs in lib current config, not exe config [message #1782674 is a reply to message #1782598] |
Tue, 27 February 2018 13:24  |
Eclipse User |
|
|
|
Thanks David - understood that config names are just names - my question would be better put as to how to make an exe that uses a dependent lib link a specific config.
And, I figured it out - In the exe project settings, there is a top level Project References, I had linked the dependent lib project there. But, under C/C++ General->Paths and Symbols, I found there is *another* "References" tab, which also lists the other projects in the workspace - but the difference here is they can be expanded and show the dependent project custom configs as checkboxes - so you can associate the desired configs between the exe and lib projects there.
|
|
|
Powered by
FUDForum. Page generated in 0.05389 seconds