问题描述
我正在 Visual Studio 2017 中使用 C++,最近刚刚将 Windows 10 从周年更新更新为创作者更新.
I'm doing C++ in Visual Studio 2017, and just recently updated Windows 10 from Anniversary Update to Creator's Update.
我无意中发现,当我编译一个 DLL 项目时,我会收到错误信息:
I found out by accident that when I'm compiling a DLL project, I would get the error message:
LNK1104 - 无法打开文件 'kernel32.lib'
在项目属性"中稍作修改后,我注意到如果 Windows SDK 版本从 10.0.14393.0
设置为 10.0.15063.0
,则会出现错误消息.如果我把它设置回10.0.14393.0
,我可以编译得很好.
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.
我想知道为什么当 Windows SDK 版本设置为 Creator 的更新构建版本时,它会抛出此错误消息,而如果设置回周年更新的构建版本,则不会?
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?
谢谢.
推荐答案
Windows 10 创意者更新 SDK 对作为安装的一部分安装的内容以最小化磁盘脚印.这是重构导致的已知问题在 Creators Update SDK 的桌面"组件不工作的情况下工作默认安装.以前的新项目逻辑总是选择最新的 Windows 10 SDK,假设桌面部分是作为该安装方案的一部分安装.我们正在研究一个修复以备将来更新.
可用的解决方法如下:
在项目属性中选择系统上完全安装的 Windows 10 SDK 版本(即 10.0.14393.0 或更早版本)
Select a version of the Windows 10 SDK that's fully installed on the system (i.e. 10.0.14393.0 or earlier) in the Project Properties
通过 Visual Studio 安装程序安装Windows 10 SDK (10.0.15063.0) for Desktop"组件.win10sdk-15063desktop.png
Install the 'Windows 10 SDK (10.0.15063.0) for Desktop' component via the Visual Studio Installer. win10sdk-15063desktop.png
丹尼尔·格里芬
Visual C++ 库
Visual C++ Libraries
这篇关于"LNK1104 无法打开文件 'kernel32.lib' "Windows SDK 版本设置为 15063.13 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!