fatal error LNK1104: cannot open file 'kernel32.lib'

0x499602D2 picture 0x499602D2 · Feb 24, 2013 · Viewed 115.6k times · Source

I've been getting this error ever since I installed the .NET Framework SDK for 64-bit programming on my Visual C++ 2010 Express compiler. I can't compile even a simple program at all because of this single error I'm getting. My platform is x86. Here is a snap shot if it helps:

enter image description here

I don't know what more to say. I just downloaded this compiler yesterday and it was working fine. I wanted to upgrade from 32-bit programming to 64-bit so I could work with Assembly, so I downloaded this SDK. I searched on Google and even here on Stackoverflow. Google didn't help much, but I found a post here that seemed similar to mine but the answers didn't do much justice. Does anyone know why this error is occurring and how I can get rid of it?

Answer

Zaid Amir picture Zaid Amir · Feb 24, 2013

Check the VC++ directories, in VS 2010 these can be found in your project properties. Check whether $(WindowsSdkDir)\lib is included in the directories list, if not, manually add it. If you're building for X64 platform, you should select X64 from the “Platform” ComboBox, and make sure that $(WindowsSdkDir)\lib\x64 is included in the directories list.