Visual Studio 2010中没有从那些依赖所应当应该项目autolinking静态库 [英] Visual Studio 2010 not autolinking static libraries from projects that are dependencies as it should be supposed to

查看:143
本文介绍了Visual Studio 2010中没有从那些依赖所应当应该项目autolinking静态库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 创建一个C ++的一个新的解决方案控制台的命令行项目

  • 创建一个新的项目,一个C ++静态库

  • 请在命令行项目依赖于库

  • 确保链接库相关性在配置=>链接器=>常规打开(这是默认设置)

  • Visual Studio将还没有链接库。

我该如何解决这个问题?它的工作在Visual Studio 2008。

How can I fix this? It worked in Visual Studio 2008.

推荐答案

这仍然有效,但<一个href=\"http://blogs.msdn.com/b/vcblog/archive/2010/02/16/project-settings-changes-with-vs2010.aspx\">changed在VS 2010中:

This still works, but was changed in VS 2010:

在VS2010中,我们停止支持项目依赖定义含蓄地提及,我们还推出了在项目层面确定项目依赖的新途径。由于项目参考和项目依赖关系是密切的概念,既适用于一个项目,它是有道理的,让他们重新psented在一起,以统一的方式$ p $,在项目文件。正如您将在下面的代码片段看,项目定义和项目依赖的定义之间的唯一区别在于元数据定义输出组件包含/排除到/从主项目链接命令行。
  虽然我们没有删除项目依赖对话框中,我们建议通过框架和引用对话框中定义新的项目依赖。您需要将参考集合输出的属性在属性页的UI设置为false项目依赖关系,并真正为项目的参考。

"With VS2010, we stopped supporting project dependencies defining implicit references and we also introduced a new way of defining project dependencies at the project level. Since a project reference and a project dependency are close concepts, both applying to a project, it made sense to have them represented together, in a consistent way, in the project file. As you will see in the snippets below, the only difference between a project reference definition and a project dependency definition consists in metadata that defines the output assembly inclusion/exclusion into/from the main project link command line. Although we did not remove the "Project Dependencies" dialog, we recommend defining new project dependencies via the "Framework and References" dialog. You need to set the "Reference Assembly Output" property in the property page UI to false for a project dependency and to true for a project reference."

刚上控制台项目上单击右键,选择属性 - >通用属性 - >框架和引用 - >添加引用,并添加静态库项目;还要检查链接库相关性是在右手边真。似乎工作的调试和发布版本。你每天学习新的东西。 ;)

Just right-click on the console project, select "Properties->Common Properties->Framework and References->Add New Reference" and add the static library project; also check that "Link Library Dependencies" is True on the right hand side. Seems to work for debug and release builds. You learn something new every day. ;)

这篇关于Visual Studio 2010中没有从那些依赖所应当应该项目autolinking静态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆