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

标签 c++ windows visual-studio

我在 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/

相关文章:

c++ - OpenCV:如何将图像保存在一个大矩阵中然后分别调用它们?

java - 如何找到丢失的 jar ?

visual-studio - 如何在 Visual Studio 2008 中自动删除尾随空格?

python - 提高套接字传输速度

c++ - 在对象的构造函数中声明对象数组?

c++ - 为什么我不能解析这个double_?

c++ - Windows 中 FLTK 2.0 中的链接错误

java - 无法在 Java 中的 FreeTTS mbrola 中找到 *.app

visual-studio - 在 Visual Studio 2012 中使用 MSBuild PublishProfile 时的 MSDeploy 跳过规则

c++ - 临时对象的成员函数的左值引用返回是悬挂引用吗?