Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Exe project builds dependent libs in lib current config, not exe config
Exe project builds dependent libs in lib current config, not exe config [message #1782480] Fri, 23 February 2018 21:50 Go to next message
Rick Schneider is currently offline Rick SchneiderFriend
Messages: 2
Registered: February 2018
Junior Member
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 #1782598 is a reply to message #1782480] Tue, 27 February 2018 01:07 Go to previous messageGo to next message
David VavraFriend
Messages: 734
Registered: October 2012
Senior Member
What you are looking for is a global build configuration name.
I don't think there is one.

The build configurations are kept in the project file .

The names Release and Debug are commonly used
but they don't have to be the same between projects.
They could just as easily be Config1, Config2, etc.
I have a managed build project that only has Default

Besides they don't have to mean debug vs release,
e.g., they could simply have differing build variable values or header files.

You might want to look into some of the available macro plugins
and create a macro that sets the active configuration in linked projects.

[Updated on: Tue, 27 February 2018 01:15]

Report message to a moderator

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 18:24 Go to previous message
Rick Schneider is currently offline Rick SchneiderFriend
Messages: 2
Registered: February 2018
Junior Member
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.
Previous Topic:Compile linux program under windows.
Next Topic:Indexer's extern "C" confusion
Goto Forum:
  


Current Time: Sat Jun 23 05:06:45 GMT 2018

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

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

Back to the top