The solution of “the windows SDK version for 8.1 was not found” in vs2017 C + + compilation

Recently, win7 64 bit ultimate + Visual Studio 2017 was installed. It was found that there was an error in the SDK when compiling the program. The solutions on the Internet were similar, but they were not very good. After a lot of twists and turns, it was finally a perfect solution.

At compile time, vs2017 reported the following error:

vs2017 error MSB8036: The Windows SDK version 8.1 was not found.

Causes and solutions:

The main reason for this SDK version selection problem is that vs2017 uses Windows SDK 8.1 by default, but actually vs2017 does not contain this file. When compiling, vs cannot find this file, so it will report an error.

At this time, you only need to download the latest version of the SDK to install. Because of the downward compatibility of the SDK, this problem can be solved in win7/win8/win10.

1. First of all, right-click the project to be compiled &> &> properties &> &> configuration properties &> &> general to check the version number of the windows SDK. It is found that it is 8.1, and there is no other version number option in the drop-down menu. Here, because it has been installed, a new version number appears.

After confirmation, I found some online methods. For example, right-click on the project and select “retarget SDK version” to pop up the new version installation option. I don’t have this one. I can only download and install it myself.

2. Log in to the official website of windows SDK: https://developer.microsoft.com/zh-cn/windows/downloads/windows-10-sdk , download the windows 10 SDK (10.0.16299.15). I can download the. EXE file and double-click it directly. Then other options can be installed on Disk C by default. The installation time may be long or short. I spent 2 hours to install last night, but it only took 10 minutes this morning.

(someone on the Internet said that it must be installed in the SDK folder under the installation path of vs. there is no need to test it by yourself. It can be installed by default, and it does not affect the use.)

Pay attention to check the version compatibility of the SDK. The above downloaded version is the latest and fully applicable to win7 system. The details can be described in the above website, as shown in the figure:

3. After the installation, re execute the viewing method in step 1, and you can find that the new version number 10.0.16299.15 appears in the drop-down menu. Select the version number and click the application and confirmation below to compile the program again. It is found that the program can pass successfully.

Problem solving.

Similar Posts: