Sign in to follow this  
Boltimus

.lib and dll files

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this