郑州普罗旺世怎么样:LIB vs DLL

来源:百度文库 编辑:九乡新闻网 时间:2024/04/28 15:26:21
LIB vs DLL

When developing software, we are oftenasked whether we want to use LIB or DLLs in containing functions for theapplication. LIB is a static library where functions and procedures canbe placed and called as the application is being compiled. A DLL orDynamic Link Library does the same function but is dynamic in a sensethat the application can call these libraries during run-time and notduring the compilation. This presents a few significant advantagescompared to using LIB.

For starters, you would have a singlefile that is significantly bigger as it contains all of the code whileyou would have multiple smaller files when using DLL. Compiling yourfunctions and procedures would also allow you more reusability as onceyou are happy with the functions on the DLL because you can keep it asis with each version of the application and not have to mess with it.You can also use the same DLL if you want to create another applicationthat uses the same functions and procedures. You can directly link tothe DLL rather than copy the code from the source as you would need todo with LIB.

A problem with DLL is when youchange the content of the DLL. This can lead to versioning problemswhere an application uses the incorrect version of the DLL causingproblems. You need to keep track of your DLLs in order to avoid theseproblems. You would not have this problem with LIB as you would only getone large file.

When developing the software andchoosing DLL, you would still have a LIB file in your project. Butunlike when using LIB, this file does not contain the code of thefunctions and procedures but only stubs that the program needs to callthe procedures from the DLL’s.

Summary:
1. A DLL is a library that contains functions that can be called byapplications at run-time while LIB is a static library whose code needsto be called during the compilation
2. Using LIB would result in a single file that is considerable bigger while you end up with multiple smaller files with DLL’s
3. DLL’s are more reusable than LIBs when writing new versions or totally new applications
4. DLL files can be used by other applications while LIB files cannot
5. DLL’s are prone to versioning problems while LIB is not
6.?  You would still have a LIB file when developing software with DLLs but it only contains stubs


Read more: Difference Between LIB and DLL | Difference Between | LIB vs DLL http://www.differencebetween.net/technology/difference-between-lib-and-dll/#ixzz1PJMrBWxz