LNK1004:无法打开文件“Jsfwbase12D.lib”
所以,我对编译/链接 C++ 项目时遇到的这个错误有点困惑。
在链接器配置的输入部分中,我们有一个文件名为 Jsfwbase12D.lib 的附加依赖项。该文件最近更改为Jsfwbase12.lib,没有大写D。我将项目中的引用更改为新文件名,然后尝试重新编译并收到以下错误消息。
Error 2 fatal error LNK1104: cannot open file 'Jsfwbase12D.lib' m5gaddrs m5gaddrs
我在记事本中打开 vcproj 文件并搜索旧文件名,但发现零结果。
有谁知道为什么链接器不寻找正确的文件而是试图找到旧的文件?
编辑: 我在记事本中打开了 obj 文件,找到了旧的 Jsfwbase12D.lib 参考。所以看来这就是链接器失败的原因。现在真正的问题是,如果没有在任何地方指定这些引用,为什么编译器要插入这些引用以用于调试模式?
/DEFAULTLIB:"Jsfwbase12D.lib"
So, I'm a bit confused on this error that I'm getting while compiling/linking a C++ project.
In the Input section of the Linker configuration, we have a additional dependency with the file name Jsfwbase12D.lib. This file was recently changed to Jsfwbase12.lib without the capital D. I changed the references within the project to the new file name and then attempted to re-compile and got the below error message.
Error 2 fatal error LNK1104: cannot open file 'Jsfwbase12D.lib' m5gaddrs m5gaddrs
I opened up the vcproj file in notepad and searched for the old file name and it found zero results.
Does anyone have any idea why the linker isn't looking for the correct file and instead trying to find the old one?
Edit:
I opened the obj file in notepad and found the old Jsfwbase12D.lib reference. So it appears that's why the linker is failing. Now the real question is, why is the compiler inserting those references for debug mode if they are not specified anywhere?
/DEFAULTLIB:"Jsfwbase12D.lib"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的代码可能在某处包含
#pragma comment(lib, "Jsfwbase12D.lib")
。这会通知链接器在链接期间包含的依赖项。Your code likely contains
#pragma comment(lib, "Jsfwbase12D.lib")
somewhere. This informs the linker of a dependency which gets included during link time.