gpt4 book ai didi

c++ - "LNK1104 Cannot open file ' kernel32.lib ' "当 Windows SDK 版本设置为 15063.13 时

转载 作者:可可西里 更新时间:2023-11-01 13:55:38 24 4
gpt4 key购买 nike

我在 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 构建版本则不会?

谢谢。

最佳答案

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 (i.e. 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

关于c++ - "LNK1104 Cannot open file ' kernel32.lib ' "当 Windows SDK 版本设置为 15063.13 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43422105/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com