Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Is it possible to have one project depend on another project within the same solution? Say I have project A, which statically links to project B, how would I set this up? Ideally I would like to not mention project B's path from within project A, but rather have them output their files maybe in the same folder up in the directory tree. (Maybe using the solution path)

Would outputing program A & B both in the same directory just let it work? I've set A to depend on B already (so B always builds when A does), but it is a static library, so I'd expect it to have to somehow be mixed up with the object file and not the executable?


EDIT: I have both output directories set to the same directory, but it is not linking.

like image 478
Jeroen Avatar asked Dec 18 '13 14:12

Jeroen


1 Answers

The proper way to do this is to configure the solution dependencies appropriately. In the solution explorer, right click solution -> Project dependencies... -> configure appropriately. Assuming you configure that correctly, you don't need to mention any paths or libraries in the linker, the dependant libs will link automatically.

Under VisualD, this works for C/C++ and D projects. I have D projects which depend on C libraries working fine.

like image 161
Manu Evans Avatar answered Nov 06 '22 04:11

Manu Evans