LNK2019 / 2001:未解析的外部符号
我在网上看到过类似的问题,这些问题是人们忘记包含某些内容等的问题。但是,在从 subversion 检查我们的代码后,我收到了此错误 - 其他人也做了同样的事情,但没有遇到此问题。我的问题:我的计算机上是否有任何可能发生的事情导致此链接器错误,无论是在 Visual Studio 设置中(但不会影响 .sln 文件)还是在 Visual Studio 外部?
Lnk2019,来自此处指出:
函数“function”中引用的未解析的外部符号“symbol”
Lnk2001,来自此处指出
无法解析的外部符号“symbol”
编辑:LNK2019 错误是由初始 LNK2001 错误引起的(在创建某个 dll 时出现问题)。如果我从我们团队的其他人那里获得该 dll(并将创建日期调整为明天,这样 VS 就不会删除它),我就可以编辑和调试。当然,我不想诉诸解决方法......
I've seen similar questions online that are problems with people forgetting to include certain things, etc. However I'm getting this error after checking out our code from subversion--others have done the same without getting this problem. My question: is there anything that could've happened on my machine to cause this linker error, either in Visual Studio settings (but not something that would affect the .sln file) or outside Visual Studio?
Lnk2019, from here states:
unresolved external symbol 'symbol' referenced in function 'function'
Lnk2001, from here states
unresolved external symbol "symbol"
Edit: The LNK2019 errors result from the initial LNK2001 error (on a problem creating a certain dll). If I get that dll from someone else on our team (and adjust the creation date to tomorrow so VS won't delete it) I can edit and debug. Of course I would like to not resort to a workaround...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您链接到的库有可能是您的计算机上不再存在的本地副本。当有人导入库依赖项并使用 C:\ 驱动器中的绝对路径来指定其位置时,就会发生这种情况。
There's a chance that the library you were linked to was a local copy that no longer exists on your machine. We had this happen when someone imported a library dependency and used an absolute path from their C:\ drive to specify its location.
除了托尼的回答之外,如果您的库搜索路径中的旧版本库比您构建的库复制到的位置更高,也可能会发生这种情况。 中列出的所有位置。
我会检查“工具->选项->项目和解决方案->VC++目录->“显示目录:库文件”
In addition to Tony's answer, this can also happen if you have an older version of the library higher in your lib search path then where the lib you built was copied to. I'd check all the places listed in:
"Tools->Options->Projects and Solutions->VC++Directories->"Show Directories for: Library Files."