Visual Studio 2013 error LNK1104: cannot open file 'kernel32.lib'

Oct 30, 2014 at 6:29am
I'm absolutely new to windows programming (and Visual studio). When i try to build any project (VC++ or WIN32), i get the error:
Visual Studio 2013 error LNK1104: cannot open file 'kernel32.lib'

Can someone please guide me in the right direction?
Oct 30, 2014 at 6:31am
is your operating system 64 bit?
Oct 30, 2014 at 6:36am
I'm on a 32 bit system.
Oct 30, 2014 at 7:31am
Is Windows SDK installed ? It does NOT came with Visual Studio Express version.
Oct 30, 2014 at 8:06am
There is a Micrsoft SDKs folder which contains a Kernel32.lib:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\Kernel32.lib

Is this the one?
Last edited on Oct 30, 2014 at 8:07am
Oct 30, 2014 at 8:20am
Yes. But you are using VS2013 ?
Last edited on Oct 30, 2014 at 8:20am
Oct 30, 2014 at 8:53am
Yes, its VS2013.
Oct 30, 2014 at 9:32am
So what platform toolset is your VS2013 setup to use ? v6.0 looks very old, I think VS2008 or 3005 use it by default.

To see go to project properties -> General -> Platform toolset. Also check "VC++ directories" If problems persists you can manually change "Library Directories" to match your configuration (not recommended, kernel32.lib must came from VS2013, not some old version, otherwise bad things could still happen)
Oct 30, 2014 at 11:34am
The platform toolset is set to:
Visual Studio 2013 (v120)

My "Library Directories" values have:
1. $(VC_LibraryPath_x86) has values:
     -- C:\Program Files\Microsoft Visual Studio 12.0\VC\lib        (no kernel32.lib here)
     -- C:\Program Files\Microsoft Visual Studio 12.0\VC\atlmfc\lib  (i can't locate the atlmfc folder)
2. $(WindowsSDK_ExecutablePath_x86) -- The macro is not defined in the macros list!
Last edited on Oct 30, 2014 at 11:39am
Oct 30, 2014 at 2:04pm
Install windows SDK from here:
http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx

A restart may be required.
Oct 31, 2014 at 1:05am
I just reinstalled VS2013, and all seems fine now. Thanks for the help.
Topic archived. No new replies allowed.