Author Topic: Linking to dependent static library  (Read 5423 times)

Edis K.

  • Guest
Linking to dependent static library
« 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Linking to dependent static library
« Reply #1 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.
Be patient!
This bug will be fixed soon...

Edis K.

  • Guest
Re: Linking to dependent static library
« Reply #2 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! ^_^

ghorwin

  • Guest
Re: Linking to dependent static library
« Reply #3 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Linking to dependent static library
« Reply #4 on: August 17, 2006, 09:49:08 pm »
Quote
Could that be implemented sometime soon?

Sometime, possibly. Soon, no.
Be patient!
This bug will be fixed soon...