开发者

Library importing: #pragma comment VS Visual studio project input

  1. using #pragma comment(lib, "../../xxx.lib")
  2. using Visual studio project option

    Library importing: #pragma comment VS Visual studio project input

What开发者_如何学Python is the advantage and disadvantage between two method?

I'm finding way which is better convenient to manage for many projects.

And what method does Microsoft recommend?


The advantage of #pragma comment is that the user of your library cannot forget to add the setting. Or add the wrong one, it is not uncommon to get lost at the difference between the debug and release build and the /MD vs /MT build. One disadvantage is that troubleshooting linker problems can be difficult in some cases.

There's a third way that's hard to beat for convenience in a solution. Right-click the project that requires the library and click Project Dependencies. Tick the library project. This ensures that the library project is always built before the project and the .lib is automatically added.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜