In visual studio, does pragma comment link same library multiple times if written multiple times? Or comments second onwards ignored? I've checked comment but it doesn't seem to be clearly stated.
In visual studio, does pragma comment link same library multiple times if written multiple times? Or comments second onwards ignored? I've checked comment but it doesn't seem to be clearly stated.
Share Improve this question asked Mar 13 at 17:02 yoonsohyoonsoh 651 silver badge4 bronze badges1 Answer
Reset to default 1In Visual Studio, if you write
#pragma comment(lib, "somelibrary.lib")
several times for the same library, it does not link the library multiple times. The linker will just ignore duplicate entries.
Although this behavior is not explicitly documented in the documentation, but it follows the general rule that the linker avoids multiple linking of the same library. If the same library is specified multiple times in different source files, the linker only considers it once.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744688944a4588089.html
评论列表(0条)