User forums > Using Code::Blocks
Linking to dependent static library
(1/1)
Edis K.:
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.
mandrav:
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.
Edis K.:
*sticks foot in mouth*
I've should have checked more ^.^; Yep that did the trick. Thanks a lot! ^_^
ghorwin:
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
mandrav:
--- Quote ---Could that be implemented sometime soon?
--- End quote ---
Sometime, possibly. Soon, no.
Navigation
[0] Message Index
Go to full version