Visual Studio 2010 是否打破了“项目依赖关系"?在 C++ 项目之间?
在 Visual Studio 2008 中,如果我有一个包含多个 C++ 项目的解决方案,我可以使用项目依赖项"选项使它们相互依赖并正确链接.这修复了构建顺序,并且还创建了(例如)针对静态库输出的主应用程序项目链接.
In Visual Studio 2008, if I had a solution containing multiple C++ projects, I could make them depend on each-other and correctly link by using the "Project Dependencies" option. This fixed up the build order and also made (e.g.) the main application project link against the static library outputs.
在 Visual Studio 2010 中,这似乎不起作用.Visual Studio 2010 是否改变了它的工作方式?
In Visual Studio 2010, this doesn't seem to work. Did Visual Studio 2010 change the way this works?
是的.您还需要添加参考 到依赖项目.这不再仅适用于托管 C++(或 C++/CLI)应用程序.
Yes. You also need to add a Reference to the depended-upon project. This is not just for managed C++ (or C++/CLI) applications any more.
Visual C++ 团队博客有一个关于此的条目:灵活的项目到项目引用.
The Visual C++ Team Blog has an entry about this: Flexible Project-to-Project References.