User forums > Using Code::Blocks

[SOLVED] Howto make C::B link library,when it was changed,but *.h files are not?

(1/2) > >>

Laethnes:
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

MortenMacFly:

--- Quote from: Laethnes on February 01, 2010, 01:27:51 pm ---Is there any option I missed, that enables checking linked libs for change and re-link project?

--- End quote ---
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.

Laethnes:

--- Quote from: MortenMacFly on February 01, 2010, 02:59:58 pm ---
--- Quote from: Laethnes on February 01, 2010, 01:27:51 pm ---Is there any option I missed, that enables checking linked libs for change and re-link project?

--- End quote ---
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.

--- End quote ---
Oh, thank you very much :), it's exactly I need.

richarduk:
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.

tankist02:
I agree - when a library is added to an executable project the library should be set as external dependency.

Navigation

[0] Message Index

[#] Next page

Go to full version