(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