How to make one project dependent on another in Visual Studio?

Is it possible for one project to depend on another project within the same solution? Say I have a project A that statically links to project B, how would I set this up? Ideally, I would like not to specify the path of project B from project A, but rather have their output of their files, possibly in the same folder in the directory tree. (Perhaps using a solution path)

Will the output of programs A and B be in the same directory, just let it work? I found that A already depends on B (so B always builds when it does A), but it is a static library, so I expect it to somehow mix with the object file, not the executable?


EDIT: I have both output directories installed in the same directory, but they are not related.

+6
source share
1 answer

The right way to do this is to properly configure the solution dependencies. In the solution explorer, right-click → Project Dependencies ... → configure accordingly. Assuming that you have configured this correctly, you do not need to specify any paths or libraries in the linker, dependent libraries will link automatically.

In VisualD, this works for C / C ++ and D projects. I have D projects that depend on C libraries that work fine.

+6
source

All Articles