Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Laethnes on February 01, 2010, 01:27:51 pm
-
In one workspace, I have one project as a static library and a few projects as executable, which are linking the static lib. In Prosperites -> Project's dependencies I did set dependencies so that all executables are dependent on static lib, so when I click Build, the static lib is build first, then is build exe project and then is all linked, which works nice. Problem is, when I change some source in the static lib but NOT any header file and NOT any file in exe project, static lib is build but exe project is not re-linked. Is there any option I missed, that enables checking linked libs for change and re-link project?
- I make sure, that I'm switched on exe project
- It all works fine, if I change some header file, which is included in exe project or when I change some file in exe project
- CodeBlocks: SVN 6088 (but this occurs on 8.04 too)
- OS: Windows XP, GNU Linux Ubuntu 9.10, both 32bit
- compiler: on Win MinGW-gcc: 3.4.5, on Linux: actualized GNU GCC
-
Is there any option I missed, that enables checking linked libs for change and re-link project?
Yes, it's called external dependencies:
(Right click on) Project -> Properties -> Tab "Build targets" -> button "Dependencies" -> Place a link to your library in "External dependency files" and read the comment in that dialog. ;-) Do this step for very (relevant) target.
-
Is there any option I missed, that enables checking linked libs for change and re-link project?
Yes, it's called external dependencies:
(Right click on) Project -> Properties -> Tab "Build targets" -> button "Dependencies" -> Place a link to your library in "External dependency files" and read the comment in that dialog. ;-) Do this step for very (relevant) target.
Oh, thank you very much :), it's exactly I need.
-
I had this same problem, has a pre build script that created some header files. The stated fix in this thread fixed my issue but should it not happen auto magically when you say that one project is dependent of another? Seems very counter intuitive.
-
I agree - when a library is added to an executable project the library should be set as external dependency.
-
I agree - when a library is added to an executable project the library should be set as external dependency.
Indeed, I hope this will be the case soon in C::B.
See a very similar discussion here, suggesting the same http://forums.codeblocks.org/index.php/topic,14882.0.html (http://forums.codeblocks.org/index.php/topic,14882.0.html)