Dynamic link library and static link library

There are two types of libraries: dynamic link libraries and static link libraries.

First, use a dynamic link library:

Through Project - Properties - Configuration Properties - General - Project Defaults - Configuration Type, select the Dynamic Library (.dll) option

This will generate both .lib and .dll files.

It's just that the .lib file does not contain the program implementation file, but only the function entry information, so it must be used with the generated .dll file.

When used, it is divided into static linking and dynamic linking.

Static linking requires three files: .h, .lib, and .dll

The dynamic link only needs the .dll file, and the function entry address is obtained through LoadLibrary loading.

Second, use the static link library:

Through Project - Properties - Configuration Properties - General - Project Defaults - Configuration Type, select the Static Link Library (.lib) option

This only generates .lib files.

The lib file contains not only the program entry address, but also the program implementation code, which is different from the above .lib file.

Only the header file and the lib file are needed when using it.

References: https://blog.csdn.net/piaoxuezhong/article/details/64127436

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324870660&siteId=291194637