C++ 无法打开文件“LIBC.lib”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6016649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
cannot open file 'LIBC.lib'
提问by Maanu
I changed a workspace developed in VC 6.0 to VS 2008. When I tried to build the workspace I am getting the following error message. How can I correct the problem?
我将在 VC 6.0 中开发的工作区更改为 VS 2008。当我尝试构建工作区时,收到以下错误消息。我该如何解决问题?
fatal error LNK1104: cannot open file 'LIBC.lib'
I am getting the following messages when I ignored libc.lib
当我忽略 libc.lib 时,我收到以下消息
Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) class CIHoTSimEngine * __cdecl CreateHoTSimEngine(void)" (__imp_?CreateHoTSimEngine@@YAPAVCIHoTSimEngine@@XZ) referenced in function "private: int __thiscall CHoTSimV2Doc::Init(void)" (?Init@CHoTSimV2Doc@@AAEHXZ) HoTSimV2Doc.obj HoTSimV2
Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) class CIFABConnect * __cdecl CreateFabConnectServer(void)" (__imp_?CreateFabConnectServer@@YAPAVCIFABConnect@@XZ) referenced in function "private: int __thiscall CHoTSimV2Doc::Init(void)" (?Init@CHoTSimV2Doc@@AAEHXZ) HoTSimV2Doc.obj HoTSimV2
Error 3 fatal error LNK1120: 2 unresolved externals D:\Projects\AsWorxSim\Bin\Release\HoTSim2.0.exe 1 HoTSimV2
回答by Alok Save
Project Property -> Configuation Properties -> Linker -> Input -> Ignore Specific Library
项目属性 -> 配置属性 -> 链接器 -> 输入 -> 忽略特定库
Ignore the LIBC.LIB
忽略 LIBC.LIB
Edit: I think once you remove the LIBC.lib as mentioned above, you are moving ahead with your linking and getting errors which exist in your app. You should try to look in these errors now. Think about it, if libc.lib was missing in the first place then how could it provide any linkage which seems to have appeared after you ignored it.
编辑:我认为一旦您如上所述删除了 LIBC.lib,您就可以继续进行链接并获取应用程序中存在的错误。您现在应该尝试查看这些错误。想一想,如果首先缺少 libc.lib,那么它如何提供在您忽略它之后似乎出现的任何链接。
回答by Raiv
look here: Discussion about libc on microsoft forumthat's for vs2005 but for 2008 it is the same...
看这里: 微软论坛上关于 libc 的讨论是针对 vs2005 但对于 2008 来说是一样的......
回答by Ben Voigt
You need to "Rebuild All", to make sure you don't have any .obj files from VC6 hanging around.
您需要“全部重建”,以确保您没有任何来自 VC6 的 .obj 文件。
回答by golem
Command line option:
命令行选项:
cl source.cpp /link /NODEFAULTLIB:LIBC.LIB