LNK2019“无法添加项目间参考" [英] LNK2019 "Unable to add a project-to-project reference"

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

问题描述

我有几个需要构建的VS项目.可能值得注意的是,这些项目的上一次构建是在VS2008上进行的,现在我需要使用VS2015.我注意到错误代码LNK2019上的msdn链接指出了这种情况的可能原因 我认为与我的案件有关的错误.其描述为

I have several VS projects that I need to build. It may be worth noting that the last time these projects were built was with VS2008 and now I'm required to use VS2015. I've noticed the msdn link on error code LNK2019 points out a possible cause of this error that I believe is related to my case. Its described as 

" 构建依赖项是 如果 您的项目没有项目间参考,您可能会收到此链接器错误.添加一个项目到项目的引用以对其进行修复."

"A build dependency is only defined as a project dependency in the solution. In earlier versions of Visual Studio, this level of dependency was sufficient. However, starting with Visual Studio 2010, Visual Studio requires a project to project reference. If your project does not have a project-to-project reference, you may receive this linker error. Add a project-to-project reference to fix it."

总共有"5"个我正在建设的项目.我已经能够成功构建三个,但是后两个总是抱怨带有错误代码"LNK2019"的外部符号.事实上,这些"LNK2019"中的大多数那个错误 显示所有指向一个名为xxxxxAPI.lib(si_api.obj)的文件.我尝试按照指示从此处< https://msdn.microsoft.com/zh-cn/library/f3st0d45.aspx>将项目添加到项目参考中.但是,当我进入添加参考"时, 我收到一个黑色对话框,在添加项目时没有任何选择.

There are a total of "5" projects i'm building. I've been able to build three successfully but the last two keep complaining about external symbols with error code "LNK2019". In fact the majority of these "LNK2019" errors that show up all point to one file called xxxxxAPI.lib (si_api.obj). I've tried following the instructions in adding a project to project reference from here <https://msdn.microsoft.com/en-us/library/f3st0d45.aspx>. However when I go into "Add Reference" i'm greeted with a black dialog box giving me no options in projects to add.

我确定这是我所缺乏的理解,并且希望您能提供任何反馈意见.如果您对回答的细节如此友善,那会很好,因为我不是VS专家.

I'm sure this is a lack of understanding on my part and would appreciate any feedback. If you would be so kind in being detailed on your answer that would be great as I'm not a VS guru.

谢谢

〜S

推荐答案

您好regnar86,

Hi regnar86,

>>但是,当我进入添加参考"时,我收到一个黑色对话框,在添加项目时没有任何选择.

根据您的描述,您的项目已从VS2008升级到VS2015.我建议您创建一个具有相同名称的新空白解决方案,然后通过Add->将原始项目添加到新解决方案中.现有项目.这可以帮助我们检查是否 升级项目时有任何问题.

According to your description, your project is upgrade from VS2008 to VS2015. I suggest you create a new blank solution with the same name and then add the original projects into the new solution by Add -> Existing Project. This could help us check whether there has any problem when upgrade the project.

此外,请创建包含多个项目的新解决方案,然后尝试以相同的步骤添加项目参考.如果它也有同样的问题,则此问题应与您的Visual Studio本身有关.请尝试执行以下步骤进行故障排除 这个问题.

In addition, please create a new solution with multiple projects and try add project reference with the same steps. If it also has the same problem, this issue should be related to your Visual Studio itself. Please try with following steps to troubleshooting this issue.

  1. 确保您的Visual Studio 2015安装了最新更新.
  2. 以管理员身份运行Visual Studio,以确保它具有足够的权限来执行任何操作.
  3. 安全模式以检查此问题是否与VS软件包有关.
  1. Make sure your Visual Studio 2015 has installed the latest update.
  2. Run Visual Studio as administrator to make sure it has enough permission to do any operations.
  3. Run Visual Studio in safe mode to check whether this issue related to VS packages.

>>事实上,这些"LNK2019"中的大多数所有显示的错误都指向一个名为xxxxxAPI.lib(si_api.obj)的文件.

请首先检查xxxxAPI.lib文件是否存储在链接目录中.并且您提供的文档中列出了其他可能的原因,请检查xxxAPI.lib问题是否不是由构建依赖项是 只能在解决方案中定义为项目依赖项."

Please check whether the xxxxAPI.lib file stored in the linked directory first. And there are other possible reasons listed in the document that you provided, please check whether the issue for xxxAPI.lib issue is not caused by "A build dependency is only defined as a project dependency in the solution".

最好的问候,
Weiwei

Best Regards,
Weiwei


这篇关于LNK2019“无法添加项目间参考"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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