Lib is required during compilation and is required during dll runtime. If you need to complete source code compilation, it is enough to have lib. If the dynamic connection program runs, it is enough to have a dll.
Generally, dynamic library programs include lib files and dll files. The lib file must be connected to the application in the compiler, and will be called only during the runtime of the dll file.
If a dll file exists, the lib file is generally indexed. The specific implementation is in the dll file.
If only the lib file is available, the lib file is statically compiled and the indexes and implementations are all included.
The advantage of static compiling lib files is that dynamic libraries are no longer needed during installation. However, there are also some disadvantages, that is, the application is relatively large and the flexibility of the dynamic library is lost. During version upgrade, new applications must be released at the same time.
Compiling is done through the static link library (lib) to find the interface. Eg: # pragma comment (lib, "libmysql. lib ")