LNK1104:无法打开文件"kernel32.lib" [英] LNK1104: cannot open file 'kernel32.lib'

查看:688
本文介绍了LNK1104:无法打开文件"kernel32.lib"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了VS2010,但是发现智能感知无法正常工作.我在网上浏览后发现,我不是唯一遇到此问题的人.因此,我安装了VS2008,一切都很好.然后,我决定清理计算机并删除VS2010,并立即开始在我的程序(新旧)上出现此错误.即使是只有一个cout命令的简单测试程序.我尝试修复VS2008,但没有成功,因此我尝试卸载然后重新安装,但仍然遇到相同的问题.

I Had VS2010 installed but found that intellisense wasn't working. I looked on the web and found that I wasn't the only one who had that issue. So, I installed VS2008 and everything was fine. Then I decided to clean up my computer and removed VS2010 and immediately started getting this error on my programs (new and old). Even a simple test program that has one cout command. I tried repairing VS2008 and that didn't work so I tried to uninstall and then reinstall and still I am getting the same problem.

我已经在网上寻找此问题,尽管我发现很多其他人都在遇到此问题,但事实并非如此.他们遇到了其他外部引用的问题,而不是像kernel32和lib32等应自动包含的那些外部引用.

I have looked online for this issue and though I have found a lot of other people are experiencing this issue it is not the same. They are having problems with other external references, not the ones that should automatically be included like kernel32 and lib32 etc.

我还尝试了适用于某些人的解决方案以及他们的其他参考,我在我的kernel32目录中包含了路径(带引号和不带引号),但仍然遇到相同的问题,或者在某些情况下会得到

I also tried the solution that worked for some people with their other references and I included the path (with and without quotes) to my kernel32 directory but still I get the same problem, or in some instances I will get

LNK1104:无法打开文件'C:\ WINDOWS \ system32.obj'

LNK1104: cannot open file 'C:\WINDOWS\system32.obj'

链接器配置中带引号和不带引号.

with and without quotes in the linker config.

任何人都可以帮忙吗?

推荐答案

我认为您在这里寻找的选项是-MT而不是-MD.我遇到了同样的问题.您会注意到,使用此选项时,DLL的大小要大得多(包括依赖项)

I think the option you are looking for here is -MT instead of -MD. I ran into the same problem. You will notice that when you use this option, the size of the DLL is much larger (includes dependencies)

这篇关于LNK1104:无法打开文件"kernel32.lib"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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