News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

[solved] linking problem where one static library uses another static library

Started by kai, May 22, 2006, 07:33:59 PM

Previous topic - Next topic

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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

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.