Author Topic: [solved] linking problem where one static library uses another static library  (Read 4483 times)

Offline kai

  • Multiple posting newcomer
  • *
  • Posts: 25
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
« Last Edit: May 22, 2006, 09:25:22 pm by kai »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Hello,

Did you try with project dependencies (Project-->Properties-->Targets-->Dependencies)?

Best wishes,
Michael

Offline kai

  • Multiple posting newcomer
  • *
  • Posts: 25

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.

Offline kai

  • Multiple posting newcomer
  • *
  • Posts: 25
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.
« Last Edit: May 22, 2006, 09:16:46 pm by kai »