无法为几个解决方案添加参考 [英] Unable To Add Reference To A Couple Of Solutions

查看:93
本文介绍了无法为几个解决方案添加参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计:

  在Windows 10 Pro,VS 2015社区,所有C ++上进行开发。

   Developing on Windows 10 Pro, VS 2015 Community, all C++.

  另一天,另一个奇怪的问题...

   Another day, another weird problem...

  一个大型应用程序运行良好。 它使用我的一个名为"windows_utilities"的库。 

   A large application is running well.  It uses a library of mine called "windows_utilities". 

  我需要为安装程序Inno编译一个程序来运行。 这将设置数据库等。 

   I need to compile a program for the installer, Inno, to run.  This will setup the database among other things. 

  该程序名为"net_results_install"。我也有一个卸载程序。 


   This program is named "net_results_install". I also have an uninstaller program. 

  当我尝试构建它或卸载程序时,我得到"LNK2001:未解析的外部符号"。 。错误 

   When I attempt to build it, or the uninstaller, I get "LNK2001: unresolved external symbol" errors. 

  缺少的功能在windows_utilities库中定义,该库列在项目的Solution Explorer页面中。 

   The missing function is defined in the windows_utilities library, which is listed in the project's Solution Explorer page. 

  这不是问题。 我在解决方案资源管理器中打开net_results_install的条目并添加引用。 我看到它没有被选中:

   This isn't a problem.  I open net_results_install's entry in the solution explorer and add the reference.  I see it isn't selected:

  只需点击一下即可解决此问题:

   One click will solve this:

  这很容易。 我稍后会处理其他参考文献。 

   That was easy.  I'll deal with those other references later. 

  让我们再试一次。

   Let's try that again.

  对于同样缺失的功能,不会出现同样的错误。

   Nope, same error, for the same missing function.

  发生了什么事?

   What's happened?

  以下是"添加参考"页面显示的内容:

   Here is what the Add Reference page shows:

  我的windows_utilities库再次被取消引用。 

   My windows_utilities library is unreferenced again. 

  该应用程序使用windows_utilities库没有任何问题。 

   The application uses the windows_utilities library with no problems. 

  我的安装程序和卸载程序项目无法引用它,并且在无法加载时无法构建。 

   My installer and uninstaller projects can't reference it, and fail to build when they can't load it. 

  我做错了什么?

   What am I doing wrong?

     谢谢你
     拉里

      Thanks
      Larry

推荐答案

这里没有很多信息可供使用。
链接器工具错误LNK2001
包含可能原因的列表。 首先,我建议您查看这些列表以查看是否存在任何已识别的问题。

There's not a lot of information to work with here. Linker Tools Error LNK2001 contains lists of possible causes.  To start, I suggest you review these lists to see if any of the identified issues exits.

就引用而言,您可以通过命名将您的windows_utilites.lib提供给链接器在项目属性中或在代码中使用(根据需要使用路径字符串)#pragma comment(lib," windows_utilities.lib")。

As far as the reference goes, you could provide your windows_utilites.lib to the linker by naming it in the project properties or by using (with path strings as necessary) #pragma comment(lib,"windows_utilities.lib") in your code.

将以下链接器选项设置为查看构建期间搜索的库 -

Set the following linker option to see the libraries searched during the build -





这篇关于无法为几个解决方案添加参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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