6

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.

1

2 Answers 2

6

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

1
  • 1
    Thanks. That's all I need for an explanation to this issue. Commented Apr 15, 2017 at 15:14
0

I have the same problem, honestly, looks like a bug in VS 2017. Just switch to 10.0.10586.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.