Dynamic Link Library, static Link Library, dynamic link, static Link

Source: Internet
Author: User

Reprinted from: http://www.cnblogs.com/dawen/archive/2010/09/22/1833031.html

Terms:

  • Dynamic Link Library
  • Static Link Library
  • Dynamic Link
  • Static Link

The dynamic link library and static Link Library represent the files of the library, while the dynamic link and static link represent the Link Method of the program to the files of the Library;

Modular programming has gone through the "no database-> static database-> dynamic database" Stage

Dynamic and Static libraries are both code repositories that provide external variables, functions, or classes. Therefore, in a program, different modules can be implemented in the form of library files, so that they can only be provided to external interfaces.

The file name suffix of the dynamic link library is DLL, and the file name suffix of the static Link Library is Lib. Some comrades may wonder: when using the dynamic link library, there are also lib files, in fact, this lib file is only the DLL export description, that is, the import and export.

Differences in Connection Methods:

The static link method is to copy the contents of the library file to the target program, that is, the operation is completed during the link. From the behavior of the static link method, it is applicable to static link libraries.

The dynamic link method is to dynamically load library files at runtime. From the behavior of the dynamic link method, it is applicable to the dynamic link library, and its call method is to run the loadlibrary function; in the program, the loadlibrary function is used to call all the dynamic link libraries. In this case, you may have some questions: when using the dynamic link library for outbound Library (LIB, didn't use the loadlibrary function ?? There are two concepts involved: explicit and implicit loading of the dynamic link library. by calling the loadlibrary function in the program code, it is the display loading method, by using the import/export method, this is the implicit loading method. I personally think that in the implicit loading, the loadlibrary function is used to load the dynamic link library, so where is the loadlibrary function in the implicit loading method? In fact, it is in the export library of the dynamic link library.

 

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.