简体   繁体   中英

“LNK1104 Cannot open file 'kernel32.lib' ” when Windows SDK version is set to 15063.13

I'm doing C++ in Visual Studio 2017, and just recently updated Windows 10 from Anniversary Update to Creator's Update.

I found out by accident that when I'm compiling a DLL project, I would get the error message:

LNK1104 - cannot open file 'kernel32.lib'

After twiddling a bit in the Project Properties, I noticed if the Windows SDK version is set from 10.0.14393.0 to 10.0.15063.0 , the error message appears. If I set it back to 10.0.14393.0 , I can compile just fine.

I would like to know why when the Windows SDK version is set to the Creator's Update build version, it's throwing this error message, yet it doesn't if set back to the Anniversary Update's build version?

Thanks.

https://developercommunity.visualstudio.com/content/problem/41913/link-fatal-error-lnk1104-in-empty-c-project.html

The Windows 10 Creators Update SDK made some significant changes to what is installed as part of the installation to minimize on-disk footprint. This is a Known Issue that results from that refactoring work where the "desktop" components of the Creators Update SDK do not get installed by default. The previous new project logic always selected the latest Windows 10 SDK, assuming the desktop portions were installed as part of that installation scenario. We are working on a fix for a future update.

The workarounds available are as follows:

  1. Select a version of the Windows 10 SDK that's fully installed on the system (ie 10.0.14393.0 or earlier) in the Project Properties

  2. Install the 'Windows 10 SDK (10.0.15063.0) for Desktop' component via the Visual Studio Installer. win10sdk-15063desktop.png

Daniel Griffing,

Visual C++ Libraries

我有同样的问题,老实说,看起来像VS 2017中的一个错误。只需切换到10.0.10586.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM