开发者

How are .libs created in your VS solution linked by another project?

开发者 https://www.devze.com 2022-12-21 00:10 出处:网络
If I have a project Foo that has a .lib as an output that\'s also used by projects Bar and Baz, how do I let Bar and Baz know where to find the library assuming开发者_StackOverflow MSVC? I have the pr

If I have a project Foo that has a .lib as an output that's also used by projects Bar and Baz, how do I let Bar and Baz know where to find the library assuming开发者_StackOverflow MSVC? I have the project dependencies set up already, but how do I #pragma comment(lib, "????/Foo.lib") properly?


You have two options.

Firstly, Visual Studio itself has a global library path that it searches for all projects. You can add directories to this via Tools > Options > Projects and Solutions > VC++ Directories > Library files.

Alternatively, you can set the library path for specific projects. In the project properties set Configuration Properties > Linker > General > Additional Library Directories.

0

精彩评论

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