visual studio - Does pragma comment link same library multiple times if same comment is written multiple times? - Stack Overflow

In visual studio, does pragma comment link same library multiple times if written multiple times? Or co

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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

In 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信