User forums > Using Code::Blocks
inherit static library dependencies
das-d:
Hello,
I haven't found a solution to my problem. Also I don't know if this wanted or unwanted behaviour.
Let's assume I have a program "userProg" that is linked to a static library "userLib". My "userLib" depends on another external static library provided by an sdk for target hardware. Now if I add my library to "userProg" that it can use it and trying to compile, I get an error that I have "undefined references" to functions of the external sdk library. This can be solved only if I add the dependcy to external library to both projects "userProg" and "userLib". Is this regular behaviour or do I have to make some special Projectsettings?
Best regards
Daniel
MortenMacFly:
--- Quote from: das-d on November 13, 2012, 08:59:06 am ---Is this regular behaviour or do I have to make some special Projectsettings?
--- End quote ---
You should better ask this question to the developer/provider of the SDK. It might be or not. Consult the developers guide what the SDK developer/provider suggests to do - then set it up in Code::Blocks accordingly.
das-d:
Hello,
thanks for your reply but I think you missunderstood. For sure in my "userLib" i have to add the sdk lib as a dependency for linker that all references can be defined. But I don't know why I have to add them to my "userProg" linker settings too. I thought with compiling of "userLib" the references are resolved and this library is fully compiled and linked. So I thougt if I add my userlib to my userProg as a linker dependency it just links to the staticlibrary and everything is fine.
BR daniel
zabzonk:
@das-d
Static libraries do not link with other static libraries, so there is no dependency or name resolution between the actual libraries - a library will of course be dependent on any headers from other sources it uses.
das-d:
yes but does this mean my userProg depends on both my own "userLib" and the sdk library?
Br Daniel
Navigation
[0] Message Index
[#] Next page
Go to full version