Click to See Complete Forum and Search --> : What is .lib and .dll


bidesh
July 5th, 2007, 08:31 AM
Hi all,

i need to develop a COM dll from a static lib. can anyone please tell me what are the steps required. i know a how to make dll but don't know much about static lib.

please explain the concepts of .lib file and .dll file.

is it possible that .lib can be used alone to write an application without a .dll

Thanks

Bidesh

S_M_A
July 5th, 2007, 08:47 AM
A lib file is more or less just a collection of obj files intended to be statically linked into your application. A dll is in a way the same thing but bundled a bit different.

A dll is not statically linked into the application. Instead the dll contains some additional code that enables it to be initialized when loaded in runtime by an application. More or less the same type of code that initializes the statically linked lib when the application is loaded.

chrishowarth
July 5th, 2007, 03:11 PM
The way I learned it is that if you statically load a DLL, you have the DLL which contains the functions you want to access, and the .lib which connects it up. The other way to link up a DLL is dynamically, but using a .lib is easier and is certainly my favourite!

S_M_A
July 5th, 2007, 04:26 PM
Basically those two methods are the same but using the lib that goes with a dll relieves you from all LoadLibrary and GetProcAddress stuff. Of course, the drawback is that you can't change dll in runtime.