In Windows, libraries with. lib and. dll suffixes are available.
What are the differences and connections between the two?
Lib is the abbreviation of the library. There are two types
A type of information that contains the DLL file where the function is located and the location of the function in the file. The code is provided by the DLL loaded in the process space at runtime. Dynamic Link Library
The other contains the Function Code itself, which is directly added to the program during compilation. Static Link Library
Difference: Lib is required during compilation and DLL is required during runtime.
Contact:
In the case of a dynamic library, there are two files, one is imported into the database (. lib) file. One is a DLL file. The imported file contains the name and location of the function exported by the DLL. The dll contains the actual function and data, the application uses the Lib file to link to the required DLL file. The functions and data in the library are not copied to the executable file. Therefore, in the executable file of the application, stores not the called function code, but the memory address of the function to be called in the DLL, in this way, when one or more applications are running, the program code is linked to the called function code, thus saving memory resources. From the above description, we can see that the DLL and. Lib files must be released along with the application, otherwise the application will produce errors. Here Lib is the first meaning of Lib.