Jump to content
  • Advertisement
Sign in to follow this  
Boltimus

.lib and dll files

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

Could someone explain the difference between the two? or at least point me in the direction where I can find out? I thought the two were one and the same thing... thanx!!! ~Bolt

Share this post


Link to post
Share on other sites
Advertisement
With .lib files you need to have a .h file with it. The code is actually INSIDE the .lib. When developing, you need to link the .lib when building your executable. (So the result of the code is inside your EXE)

With .dll files, you don't need a .h file, but you have to extract the functions from the .dll file. The result of the code is INSIDE the .dll. You can leave the .dll out when building your executable.
(Your EXE will not contain the result of the code)

I'm sure I made mistakes in this explanation, someone come correct me quick!

Share this post


Link to post
Share on other sites
Quote:
Original post by Pipo DeClown
With .lib files you need to have a .h file with it. The code is actually INSIDE the .lib. When developing, you need to link the .lib when building your executable. (So the result of the code is inside your EXE)

With .dll files, you don't need a .h file, but you have to extract the functions from the .dll file. The result of the code is INSIDE the .dll. You can leave the .dll out when building your executable.
(Your EXE will not contain the result of the code)

I'm sure I made mistakes in this explanation, someone come correct me quick!

That's a little misleading. You can use DLLs in two ways, one is to use runtime dynamic linking with a call to LoadLibrary() and then get the functions with GetProcAddress(), this is as Pipo DeClown described.

The other way is to use loadtime dynamic linking. Using this method you still have .h files which describing all the types and functions you are referencing in the DLL, and you also have a .lib file that corresponds to the DLL you're using that basically tells the compiler that everything is stored in a DLL.

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.

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!