Jump to content
  • Advertisement
Sign in to follow this  
premartha

[.net] difference between a .dll and .lib file!!

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

Can anybody please help me in understanding the core differences between a .lib file and .dll file. how windows operating system takes care of these and co-ordinate between the two. how is this mechanism different in case of MFC and .NET environments. i know a detailed discussion might be out of scope in this forum, it would be really helpful for me if anybody has some resources or links to them. i tried to search on google, but didnt get much nice explainations.

Share this post


Link to post
Share on other sites
Advertisement
My understanding is limited. But from what i know, a lib is never touched by the windows operating system, its simply a file to be linked with at compile time (for msvc, wheras borland and gcc use *.a (again, this is my understanding) ) A DLL is a file loaded at runtime by windows, which contains code for execution, and you retrieve pointers to the functions of the dll(well they're loaded into memory) so that you can later call them (GetProcAddress())

hope that helps a little
cheers
-Dan

Share this post


Link to post
Share on other sites
A .lib is a compiler thing. It's just a bunch of precompiled but not linked source files which, at link time, you can pull in to your own application. It allows you to use a body of library functionality without having to recompile it, and without having the source code.

A .dll is an operating system thing. It's a bunch of precompiled and linked code which, at runtime, you can pull in to your application. It allows you to use a body of library functionality which is in a separate file, and which can be shared by multiple applications.

To make things more confusing, .dlls usually have attendant .lib files, called "import libraries", to make them easier to use.

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!