• Advertisement
Sign in to follow this  

.lib and ,dll - what are they used for and how to make/use them?

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

.lib and ,dll - what are they used for and how to make/use them? could some one please explain this to me? I havn't needed to know untill now so I a kinda need some help.

Share this post


Link to post
Share on other sites
Advertisement
A .lib is a static library that gets linked to your code.
A .dll is a dynamic library that gets loaded by your code at runtime.
Both provide a way for you to combine large portions of shared codebase into one file.


With a .lib, this means project A doesn't need to compile all the .cpp files that were put into the .lib, it just uses the .h files and links against the .lib. This is a good way to store shared code between projects (sound API, network API, graphics API, windows even has .libs you link against)

With a .dll, everything is linked at runtime, so you can update / change the dll to change functionality. This is good for things like plugins for photoshop or maya for example, where the system expects a dll with some set of functions in it, and if it gets that it can just link and call those functions.

Share this post


Link to post
Share on other sites
DLLs are used for plug-ins, codecs, things like that.
LIBs are used for APIs, and are exclusively for C/C++.

Share this post


Link to post
Share on other sites
This is a MUST read tutorial that I found regarding this exact question not too long ago. Hope it helps.

http://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml

Share this post


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

  • Advertisement