Search code examples
c++visual-studiovisual-studio-2012linkerkernel32

kernel32.lib accidentally deleted - VS 2012 Fix


I recently installed VS2012 on my home laptop to write some software for fun in my spare time. Here's the order in which the mishap happened:

  1. Accidentally installed VS2012 for Windows 8 Apps. Realized that I actually wanted the Windows Desktop version.

  2. Uninstall the above, install VS2012 for Windows Desktop.

  3. Start writing software, everything is fine and compiles.

  4. See random VS Folder that mentions Windows 8 on my start screen - permanently delete it from computer thinking it was related to #1.

  5. My program no longer compiles, with the following common error:

error LNK1104: cannot open file 'kernel32.lib'

I searched my C-Drive to find the location of this file to try and diagnose the problem, except that it doesn't exist - I can't find it anywhere. I tried a fresh VS2012 install, and that was a bust - the same problem. I also tried to download the VS2012 SDK, but it won't install, insisting the VS2012 isn't installed, and that it's required.

What can I do!?

EDIT: I've tried to repair the install twice as well.


Solution

  • After multiple re-installs, repairs, and SDK reinstalls, the only thing that worked was a full system restore.