How are .libs created in your VS solution linked by another project?
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
.
精彩评论