Hi
what is the difference between .DLL And .LIB.
Please clearify this in bit detail.
Thanks
Bye

Re: Difference between .DLL And .LIB by Alexander

Alexander
Thu May 24 12:05:19 CDT 2007

A DLL is loaded dynamically into your process at runtime.
A static lib is linked directly into your executable image.
E.g. with a static lib you have all the code within the EXE,
whereas with a DLL the code is located in another module
and only mapped in the process at runtime. (Same applies
when creating a DLL instead of EXE - DLLs can in turn
depend on other DLLs.)

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"Muhammad Azeem Azam" <MuhammadAzeemAzam@discussions.microsoft.com> wrote in
message news:AB2F1265-0522-4AEC-90F2-50807338D3B1@microsoft.com...
> Hi
> what is the difference between .DLL And .LIB.
> Please clearify this in bit detail.
> Thanks
> Bye



Re: Difference between .DLL And .LIB by Larry

Larry
Thu May 24 12:47:19 CDT 2007

>A DLL is loaded dynamically into your process at runtime.
> A static lib is linked directly into your executable image.
> E.g. with a static lib you have all the code within the EXE,
> whereas with a DLL the code is located in another module
> and only mapped in the process at runtime. (Same applies
> when creating a DLL instead of EXE - DLLs can in turn
> depend on other DLLs.)

(For the op): Not to be confused with a LIB file that's actually an "import
library". The short story is that when your program depends on an implicitly
loaded DLL (http://msdn2.microsoft.com/en-us/library/253b8k2c(VS.80).aspx),
it's compiled against the DLL's import (.lib) file which doesn't actually
contain any code (unlike the static LIB file referred to above). It just
contains references to the DLL that are later resolved at runtime. You can
read about this online but the upshot is that when people refer to a ".lib"
file they're normally referring to the static LIB file described above (but
an import ".lib" file still comes into play for implicitly loaded DLLs).



Re: Difference between .DLL And .LIB by Carl

Carl
Thu May 24 23:00:58 CDT 2007

Muhammad Azeem Azam wrote:
> Hi
> what is the difference between .DLL And .LIB.
> Please clearify this in bit detail.

A LIB file is a module consumed by a linker to satisfy external references
in other modules. A LIB file generally contains compiled code and
associated data, but it may contain nothing more than "import descriptors"
that cause the linked image to reference some other module (typically a DLL)
at load time.

A DLL is a linked image consumed by the operating system loader. It
contains fully resolved, linked code and related data, and usually carries a
relocation table to allow the loader to place the image into any available
memory at load time. A loaded DLL image may be shared between several
processes, at runtime, if the DLL is mapped into the same address range in
the various processes.

In short, a LIB file is a development object, useful only to developers,
while a DLL is a deployment object, useful to anyone.

-cd



Re: Difference between .DLL And .LIB by John

John
Tue May 29 09:35:02 CDT 2007

Thank you. Differences between DLL and Lib is clear for me.

I have some doubts.

1. What is Dll file Image?
2. What is EXE file Image?
3. What is differeces between Implicit linking and Explicit linking?


--
Thanks & Regards,
John.


"Carl Daniel [VC++ MVP]" wrote:

> Muhammad Azeem Azam wrote:
> > Hi
> > what is the difference between .DLL And .LIB.
> > Please clearify this in bit detail.
>
> A LIB file is a module consumed by a linker to satisfy external references
> in other modules. A LIB file generally contains compiled code and
> associated data, but it may contain nothing more than "import descriptors"
> that cause the linked image to reference some other module (typically a DLL)
> at load time.
>
> A DLL is a linked image consumed by the operating system loader. It
> contains fully resolved, linked code and related data, and usually carries a
> relocation table to allow the loader to place the image into any available
> memory at load time. A loaded DLL image may be shared between several
> processes, at runtime, if the DLL is mapped into the same address range in
> the various processes.
>
> In short, a LIB file is a development object, useful only to developers,
> while a DLL is a deployment object, useful to anyone.
>
> -cd
>
>
>

Re: Difference between .DLL And .LIB by Carl

Carl
Tue May 29 10:02:12 CDT 2007

John wrote:
> Thank you. Differences between DLL and Lib is clear for me.
>
> I have some doubts.
>
> 1. What is Dll file Image?
> 2. What is EXE file Image?

"Image" refers to a file that contains, in effect, a "snapshot" of memory -
an "image" of all or part of an executable program, layed out in the file
exactly (or nearly) like it is in memory when it's running.

> 3. What is differeces between Implicit linking and Explicit linking?

http://en.wiktionary.org/wiki/implicit

implied indirectly without being directly expressed

http://en.wiktionary.org/wiki/explicit

very specific, clear, or detailed
e.g. "I gave explicit instructions for him to stay here, but he followed me,
anyway."

-cd