Visual studio 2010 express + win sdk = cannot open input file 'kernel32.lib'

I used to compile for x64 using the VS2008 express and win SDK. My machine was recently rebuilt (upgraded to 64-bit Windows 7) and received the latest express installation. Follow the same procedure to resolve x64 targets and my sources are no longer referenced. no matter what i do, i always get:

LINK: fatal error LNK1181: cannot open input file 'kernel32.lib'

a rather funny 32-bit compilation works fine.

Is this some kind of well-known problem? Google did not give me any clues on how to handle this with just a few mentions of the same problem, but no solutions.

Is it possible to use VS 2010 with win 7 SDK for target 64-bit?

thanks pawel

+19
windows 64bit visual-c ++ linker-errors
Mar 22 '12 at 11:50
source share
5 answers

the decision was dead easily at the end. The trick is to tell VS to win the SDK, which for some reason was wrong in my case. Project Properties -> VC++ Directories -> Library Directories should point to C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64

+26
Mar 23 2018-12-12T00:
source share

Something else that I discovered is also very easy - go to Project Properties-> General and install Platform Toolset in the Windows7.1SDK. I wonder why this works ...

+10
Dec 13 '12 at 13:22
source share

I had the same problem and the answers here helped me, but I had to do more.

Something ruined my installation of the Windows SDK, so I missed all the .lib files that are in C: \ Program Files \ Microsoft SDK \ Windows \ v7.1 \ Lib \ (it was fine inside the x64 folder). So I followed what was said here and reinstalled it. How can I install Platform Toolset for Windows7.1SDK (both in VS2010 and VS2013).

This works because the Platform Toolset changes the $ path (WindowsSdkDir) in Visual Studio (these paths are stored in the registry), which were corrupted if Kernel32.lib was not found.

+2
Mar 25 '15 at 14:55
source share

If none of the above solutions work. Stop and do a sanity check. I burned out using the wrong -G configuration line and this gave me this misleading error.

Start from the command line VS not the usual command line. You can find it in Start Menu -> Visual Studio 2015 -> MSBuild Command Prompt for VS2015

This sets all the correct paths to VS tools, etc.

Now let's see what generators are available from cmake ...

cmake -help

...<snip>... The following generators are available on this platform: Visual Studio 15 [arch] = Generates Visual Studio 15 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be "Win64" or "IA64". ...

Then select the appropriate line with the added arc.

mkdir _build cd _build cmake .. -G "Visual Studio 15 Win64"

Running cmake in a subdirectory makes executing "clean" easier since you can simply delete everything in this directory.

I upgraded to Visual Studio 15, but did not pay attention and tried to generate in 2012.

+1
Oct 28 '16 at 20:42 on
source share

FWIW, I had the same problem with Visual Studio 2013, when the entire installation of v8.1 SDK (files + reg keys) passed AWOL, probably caused by the installation of Emborlandero RAD Studio.

Setting the WindowsSdkDir environment variable did not have any effect, because Studio itself ( devenv.exe , an environment verified through Process Explorer) and a batch file called from a batch file called from vcvarsall.bat effectively deleted this variable because they couldn’t " t find the SDK v8.1.

Visual Studio does not allow you to configure directories of specific machines on a machine basis (the proposal to include this dependency in each project file is ridiculously without faith) and reinstalling the SDK v8.1 was not possible in a timely manner. A quick fix to get Studio to work again at the same time was to add the InstallationFolder string value under

 Software/Microsoft/Microsoft SDKs/Windows/v8.1/ 

with the same content as cousin v8.0. This value was in HKLM/Wow6432Node , but normal HKLM or HKCU should be executed.

This caused Studio to work immediately without a reboot.

0
Feb 18 '16 at 13:33
source share



All Articles