简体   繁体   English

VS C ++添加参考-找不到项目

[英]VS C++ add reference - No items found

I'm use VS 2015 Version 14.0.25431.01 Update 3. I want to add reference to lib to my project. 我正在使用VS 2015版本14.0.25431.01更新3。我想将对lib的引用添加到我的项目中。

What I do: 我所做的:

  1. Right click on "Reference" in solution explorer. 在解决方案资源管理器中右键单击“参考”。
  2. Add reference... 添加参考...
  3. Windows shows and tell that: "No items found". Windows显示并告知:“未找到任何项目”。

Already try to set "Common Language Runtime Support (/clr)" but still "No items found" statement occur. 已经尝试设置“公共语言运行时支持(/ clr)”,但仍然出现“未找到任何项目”语句。

You could try a .def file in the "Configuration Properties>Linker>Input>Module Definition File" that contains the info for your Library. 您可以在“配置属性>链接器>输入>模块定义文件”中尝试一个.def文件,其中包含您的库的信息。 https://msdn.microsoft.com/en-us/library/d91k01sh.aspx https://msdn.microsoft.com/zh-CN/library/d91k01sh.aspx

Or Stack Overflow: 或堆栈溢出:

C++ linker options for DLL (DEF, LIB, etc) DLL的C ++链接器选项(DEF,LIB等)

has good instructions on how to add a library to your project and set the Linker's "Additional Dependencies". 关于如何向您的项目中添加库并设置链接器的“其他依赖项”,有很好的说明。

PS... I've found it's difficult to take a non CLR project and try to convert it into a CLR project. PS ...我发现很难接受非CLR项目并将其转换为CLR项目。 There are lots of switches to get it all right. 有很多开关可以解决问题。 I've found it easier (when absolutely needed) to create a new CLR project and then copy the code over. 我发现(绝对需要时)创建新的CLR项目然后复制代码更加容易。 A clean CLR project will allow you to get to the "Add Reference" you are used to. 一个干净的CLR项目将使您可以使用惯用的“添加参考”。 (Just be aware CLR adds a bit more memory processing behind the scenes and can lead to slightly slower code.) (请注意,CLR在后台增加了更多的内存处理,并且可能导致代码稍微慢一些。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM