Archived

This topic is now archived and is closed to further replies.

Wymsical

Using a static library that includes another static library

Recommended Posts

Wymsical    122
I''ve got a small problem. I''ve got one library, lets call it library "a". Then i have a second one, lets call it library "b", now b links to a. now when i wright a program that links to both b and a, the linker complains about redefinitions. They''re only warnings, but but going through 400 warnings every time i want to recompile gets annoying somtimes. how do i get by this?

Share this post


Link to post
Share on other sites
Void    126
That should not happen. Your library ''a'' and ''b'' may have functions or variables that are of the same declaration.

You can fix them by declaring them static or using namespaces.

Share this post


Link to post
Share on other sites
Gorg    248
hmm, how do you make static libs link with another static lib?

A static lib should only be a container of code :*NOHTING IS LINKED*. So, if a static lib a uses function from a lib b, you simply compile lib a.

then, whenever you want to use lib a in a program you will need to link with lib a and also have to link to lib b so that all the functions in a that uses function in b be linked correctly.

Share this post


Link to post
Share on other sites
Wymsical    122
lib a is my general general programming stuff. stuff thats not even specific to game programming, like containers, ascii parsers, etc. i wanna keep all that separte. lib b is my general game stuff. when i compile the proejct that uses both a and b, it complains about every global variable, every global function, every function of every class, and every static variables in all the classes.

Share this post


Link to post
Share on other sites