User forums > General (but related to Code::Blocks)
[solved] linking problem where one static library uses another static library
(1/1)
kai:
Hi,
I have a complex workspace where one static library uses another static library. the main program links both of these libraries. i get linker errors saying there are undefined references. this happens in a file from one library that calls a function of the other library - the function has been optimized out. however if i call that function in the main program it is also available to the other library - is there a clean solution for this setup? I'm on linux using gcc 4.0.3
Kai
Michael:
Hello,
Did you try with project dependencies (Project-->Properties-->Targets-->Dependencies)?
Best wishes,
Michael
kai:
I already had the library project in Project->Properties->Project Dependencies of the other library. I have now added the library file libG3D.a itself to Project->Properties->Targets->Dependencies->External Dependencies (btw. - i also always have to add the library there for automatic recompilation - the first dependency option doesn't really help/work). Doesn't help though - that option is probably just there for automatic recompilation.
kai:
ok, works now. the library that uses another library has to be before the other one in the list of libraries to link. when dependencies are set correctly c::b could make some checks - but i would call this a minor problem.
Navigation
[0] Message Index
Go to full version