Using a static library that includes another static library

Started by
2 comments, last by Wymsical 22 years, 9 months ago
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?
Advertisement
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.
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.
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.

This topic is closed to new replies.

Advertisement