我在 Visual Studio 2017 中使用 C++,最近刚刚将 Windows 10 从周年更新更新为创作者更新。
无意中发现,在编译DLL项目时,会出现错误信息:
LNK1104 - 无法打开文件“kernel32.lib”
在项目属性中稍微调整了一下后,我注意到如果将 Windows SDK 版本从 10.0.14393.0
设置为 10.0.15063.0
,则会出现错误消息。如果我将它设置回 10.0.14393.0
,我可以正常编译。
我想知道为什么当 Windows SDK 版本设置为 Creator's Update 构建版本时,会抛出此错误消息,但如果设置回 Anniversary Update 构建版本则不会?
谢谢。
最佳答案
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:
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
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
关于c++ - "LNK1104 Cannot open file ' kernel32.lib ' "当 Windows SDK 版本设置为 15063.13 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43422105/