The role of LIB files and DLL files

Source: Internet
Author: User

(1) Lib is required at compile time, DLL is required at runtime.
If you want to complete the compilation of the source code, there is Lib enough.
If you also make a dynamically connected program run, there is enough DLL.
In the development and commissioning phase, of course, it is best to have.
(2) The General Dynamic Library program has lib files and DLL files. Lib files must be connected to the application at compile time, and DLL files are not called until the run time. If there are DLL files, then the corresponding LIB file is generally some index information, specifically implemented in the DLL file. If only the Lib file, then the Lib file is statically compiled, the index and implementation are in it. A statically compiled LIB file has the advantage of not having to hang up the dynamic library when installing to the user. But there are drawbacks, that is, the application is larger, and the flexibility of the dynamic library is lost, and when the version is upgraded, a new application will be published at the same time.
(3) In the case of the dynamic library, there are two files, one is the introduction library (. LIB) file, a DLL file that contains the name and location of the function exported by the DLL, the DLL contains the actual functions and data, the application uses the Lib file to link to the DLL file that is needed, the functions and data in the library are not copied to the executable file, Therefore, in the application's executable file, it is not the called function code, but the memory address of the function to be called in the DLL, so that when one or more applications run, the program code and the called function code are linked together, thus saving memory resources. As you can see from the instructions above, DLLs and. lib files must be released with the application or the application will produce an error.

(4) can also only Lib file, so that the library in the library functions and data are also written to the Lib file, but also in the link stage merged into the EXE, the disadvantage is to make the exe is very large, is to "library" meaning, so it is not recommended to do so.

The role of LIB files and DLL files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.