简体   繁体   English

如何安装 Windows 10 SDK 以与 Visual Studio 2017 一起使用

[英]How do I install Windows 10 SDK for use with Visual Studio 2017

I can't figure out how to install Windows 10 SDK for Visual Studio 2017.我不知道如何为 Visual Studio 2017 安装 Windows 10 SDK。

I downloaded and ran the Windows 10 SDK installer, and it displays Please find winsdksetup.exe in....\Windows kits\10\WindowsSDK to install Windows Software Development Kit - Windows 10.0.17134.12.我下载并运行了 Windows 10 SDK 安装程序,它显示Please find winsdksetup.exe in....\Windows kits\10\WindowsSDK to install Windows Software Development Kit - Windows 10.0.17134.12.

When I run winsdksetup.exe , it takes me through the same loop, where it downloads a bunch of executable installers into this directory and show the same exact message.当我运行winsdksetup.exe时,它会带我进入相同的循环,将一堆可执行安装程序下载到该目录中并显示完全相同的消息。

When I try to build a DirectX project in VS2017, I get the error:当我尝试在 VS2017 中构建 DirectX 项目时,出现错误:

MSB8036 The Windows SDK version 10.0.16299.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".    

Do I need to install one of those installers?我需要安装其中一个安装程序吗? Which one do I need to run to build and debug DirectX projects for Visual Studio?我需要运行哪一个来为 Visual Studio 构建和调试 DirectX 项目? Specifically to use VS2017 shader debugging functionality.专门使用VS2017着色器调试功能。

Thanks,谢谢,

EDIT: Under VS2017 - Tools -> Get Tools and Features I have checked编辑:在 VS2017 下 - 工具 -> 获取我检查过的工具和功能

Game Development with C++游戏开发 C++

and under Optional I have在可选的我有

C++ Profiling tools Windows 10 SDK (10.0.17134.0) C++ 分析工具 Windows 10 SDK (10.0.17134.0)

I'm downloading 16299.0, this fixed the first error of not having the right SDK.我正在下载 16299.0,这修复了没有正确 SDK 的第一个错误。

But now I get the runtime error Failed Creating the Direct3D device when running in Debug.但是现在我在调试中运行时收到运行时错误Failed Creating the Direct3D device I can still run samples in Release我仍然可以在 Release 中运行示例

The error message shows which SDK you need:错误消息显示您需要哪个 SDK:

The Windows SDK version 10.0.16299.0 was not found未找到 Windows SDK 版本 10.0.16299.0

So the SDK for Windows 10 Fall Creators Update 1709 is missing and you downloaded the SDK for April 2018 Update (1803 Build 17134).因此,缺少适用于 Windows 10 Fall Creators Update 1709 的 SDK,您下载了适用于 2018 年 4 月更新(1803 Build 17134)的 SDK。

Run Visual Studio 2017 installer ( C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe ), click on modify , and select 16299 SDK under SDK/framework in individual components tab of the installer:运行 Visual Studio 2017 安装程序( C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe ),单击modify ,然后在安装程序的各个组件选项卡中的 SDK/framework 下选择 16299 SDK:

在此处输入图片说明

You can download the required Windows SDK versions from Microsoft:您可以从 Microsoft 下载所需的 Windows SDK 版本:

https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/

Just install the required version and the build should work.只需安装所需的版本,构建就可以运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM