且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++ Visual Studio:使用注释注释链接

更新时间:2023-01-14 16:06:19

库编写器可以在公共头文件(.h)中放置 #pragma comment(lib,...)命令。在这种情况下,客户端无需将此库添加到链接器依赖项列表。通过在程序中包含h文件,客户端将自动链接到所需的库。

The library writer can place a #pragma comment(lib, ...) command in the public header (.h) file. In this case, the client doesn't need to add this library to the linker dependencies list. By including an h-file in the program, the client is automatically linked to the required library.