|
-
Oct 28th, 2001, 08:20 PM
#1
Thread Starter
Fanatic Member
Difference between .dll and .lib
If I make a dll file and use it in a program, I have to have the dll for the program to run. If I make a .lib file, how does that work? Is it compiled into the exe or what?
-
Oct 28th, 2001, 08:48 PM
#2
I think the DLL is used for dynamic linking, whereas the LIB is used for static linking.
-
Oct 29th, 2001, 05:34 AM
#3
Megatron is correct - and adding just a bit
When you link to a reference in a .lib file, you don't necessarily suck the whole .lib file into your .exe. When you have a reference to a .dll, on the other hand, you have to have the whole .dll on any system that runs your code.
The idea behind a .lib file is to make a piece of code you put on any system, with no worries abour portability. The idea behind a dll is to make a small executable, and you do have to watch movinf it from system to system.
-
Oct 29th, 2001, 08:51 AM
#4
but a dll can be shared, so different programs that use the same dll can use the same copy (even in memory), whereas libs are there as many times the programs are there. This can be a waste of memory and explains why windows is based on dll - imagine every started app needs to have it's own copy of gdi32.dll, kernel32.dll and user32.dll in memory, maybe even kernel.exe, user.exe and gdi.exe (the 16-bit versions).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 29th, 2001, 08:52 AM
#5
and the lib is compiled into the exe, yes
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 29th, 2001, 09:27 AM
#6
When DLL's are created they are linked against any libraries required... kinda like an executable file. Whereas, static libraries are not. They are more like object code (.obj files).
DLL's can also have resources compiled into them (eg. icons, bitmaps, menus, dialog templates, ect. ).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|