Stefano Bider
Stefano Bider

Reputation: 312

How can I link statically to another project, which itself needs to link to other static libraries?

I have two projects in a solution (VS 2015). One project (A) is the entry project and generates an executable. The second project (B) generates a static library. I set B as a reference in A. However B needs itself to link against some precompiled static libraries that I have locally on the dev machine. How do I do this? If I set the project's configuration type to "static library" all the linker options disappear. Thanks

Edit: I added the external libs dependencies in project A as usual via Properties > Linker > Input > Additional Dependecies but this does not solve the issue.

Upvotes: 2

Views: 345

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385395

If B is a static library then it can't "link against" anything. It's just an archive of individually compiled source files.

Its logical dependencies are inherited by the executable that uses it, i.e. A.

So add those third-party dependencies as references in A, alongside the reference to B.

Upvotes: 1

Related Questions