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

后端 未结 13 2131
既然无缘
既然无缘 2020-12-05 10:07

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 pro

相关标签:
13条回答
  • 2020-12-05 10:46

    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.

    0 讨论(0)
  • 2020-12-05 10:46

    I got a similar error, the problem stopped when I checked my "Linker -> Input -> Additional Dependencies" list in the project properties. I was missing a semi colon ";" just before "%(AdditionalDependencies)". I also had the same entry in twice. You should edit this list separately for Debug and Release.

    0 讨论(0)
  • 2020-12-05 10:50

    Add lib path of WindowsSdks in project->properties->Configuration Properties->VC++ Directories -> Library directories.

    I added following path and error goes::

    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;

    My system is Win-7, 64bit, VS 2013, .net framework 4.5

    0 讨论(0)
  • 2020-12-05 10:51

    If the above solution doesn't work, check to see if you have $(LibraryPath) in Properties->VC++ Directories->Library Directories. If you are missing it, try adding it.

    0 讨论(0)
  • 2020-12-05 10:51

    In Visual Studio 2017, I went to Project Properties -> Configuration Properties -> General, Selected All Platforms (1), then chose the dropdown (2) under Windows SDK Version and updated from 10.0.14393.0 to one that was installed (3). For me, that was 10.0.15063.0.

    Additional details: This corrected the error in my case because Windows SDK Version helps VS select the correct paths. VC++ Directories -> Library Directories -> Edit -> Macros -> shows that macro $(WindowsSDK_LibraryPath_x86) has a path with the version number selected above.

    0 讨论(0)
  • 2020-12-05 10:52

    For command line (i.e. - makefile) users only:

    1. When you install VC++ Express, it is 32-bit only. So, things go into C:\Program Files (x86).
    2. Then, you decide to upgrade to 64-bit capabillities. So, you install the SDK. But it is 64-bit capable. So, things go into C:\Program Files.

    You (like me) probably "tuned" your makefile to #1, above, via something like this:

    MS_SDK_BASE_DOS := C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
    ENV_SET         := LIB="$(MS_SDK_BASE_DOS)\Lib\x64"
    

    But, now, you need to change that tuning to #2, above, like this:

    MS_SDK_BASE_DOS := C:\Program Files\Microsoft SDKs\Windows\v7.1
    

    (Don't miss the "v7.0A" to "v7.1" change, as well.)

    0 讨论(0)
提交回复
热议问题