Jump to content
  • Advertisement

Archived

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

Wymsical

Using a static library that includes another static library

This topic is 6295 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites
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
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!