Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Edis K. on May 09, 2006, 03:48:30 am

Title: Linking to dependent static library
Post by: Edis K. on May 09, 2006, 03:48:30 am
I'm building a project with Code::Blocks in which I've set up a workspace with two projects. The first project is the GUI/executable part of the program and is set to depend on the second project, which is the logic and it's made into a static library.

When I make modifications to the GUI project or both, there's no problem. But when I only touch the static library's code, the first project doesn't re-link to the newly created library. This eventually forces me to touch one of the files and re-compile, which is kind of annoying.

Does anyone know if there's something I can do to tell CodeBlocks to call the linker if the static library was re-compiled?. Just setting up the dependencies doesn't seem to do the trick.
Title: Re: Linking to dependent static library
Post by: mandrav on May 09, 2006, 08:48:04 am
Go to the project properties (Project->Properties) of your executable project and set the static library (the relative filename) as an external dependency (External dependencies) of the target in question.
Title: Re: Linking to dependent static library
Post by: Edis K. on May 09, 2006, 08:55:34 am
*sticks foot in mouth*

I've should have checked more ^.^; Yep that did the trick. Thanks a lot! ^_^
Title: Re: Linking to dependent static library
Post by: ghorwin on August 17, 2006, 08:08:05 pm
Hi there,

after a while I also figured out that additional dependency setting. But still, I wonder why the dependency setting/adding libraries to the linker will not automatically cause a check for changed lib files? This should be an easy-to-implement feature to simply check all libs added to the linker in a build target and force a relink if one of the libs is newer than the executable.

Considering, that I have a rather complex project (workspace with 12 libs and 5 executables) where I have to manually set all library dependencies for all executables and separately in 2 build targets, I would really like to see such a "automatically checking lib files" feature in CodeBlocks.

Could that be implemented sometime soon?

Andreas
Title: Re: Linking to dependent static library
Post by: mandrav on August 17, 2006, 09:49:08 pm
Quote
Could that be implemented sometime soon?

Sometime, possibly. Soon, no.