Difference between .DLL And .LIB

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.)

 

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).

 

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

 

 

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

 

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. 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值