Jump to content
  • Advertisement
Sign in to follow this  
beebs1

Static Libraries

This topic is 3965 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

Hiya, Does anyone know - when linking an executable with a static library, is the entire library included, or just the functions which are actually used? Thanks for any help! [smile]

Share this post


Link to post
Share on other sites
Advertisement
That depends entirely on the compiler or linker. It will probably link with everything in the library though. There's not much point in leaving the unused ones out. You will save some space, but unless the library is really huge it won't be all that much.

Share this post


Link to post
Share on other sites
If you enable things like 'function level linking' or 'dead stripping', the linker will eventually get rid of all the unecessary code.

Share this post


Link to post
Share on other sites
Interesting, thanks for your replies.

I've just tested this with VS 2008 - it appears the entire library is linked (in a debug build at least).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!