C++ 如何修复错误“未找到 Windows SDK 版本 8.1”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43704734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to fix the error "Windows SDK version 8.1" was not found?
提问by no one
I recently updated visual studio 2015 and now, when i try to build anyproject it always fails and i get the error
我最近更新了 Visual Studio 2015,现在,当我尝试构建任何项目时,它总是失败并出现错误
Severity Code Description Project File Line Suppression State Error MSB8036 The Windows SDK version 8.1 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". Proj D:\Program Files (x86)\visual studio 2017\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets 34
严重性代码描述项目文件行抑制状态错误 MSB8036 未找到 Windows SDK 版本 8.1。安装所需版本的 Windows SDK 或更改项目属性页中的 SDK 版本,或通过右键单击解决方案并选择“重定向解决方案”。Proj D:\Program Files (x86)\visual studio 2017\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets 34
I retargeted the solution as it said, and the problem persisted, even though the retargetting was completed.I decided to install visual studio 2017 because of this, and, lo and behold, it did the exact same thing.I'm also using windows 7.
我按照它所说的重新定位了解决方案,即使重新定位已完成,问题仍然存在。因此,我决定安装 Visual Studio 2017,并且,瞧,它做了完全相同的事情。我也在使用 Windows 7.
What is the problem and how can i fix it?
有什么问题,我该如何解决?
回答by Felix Too
I faced this problem too. Re-ran the Visual Studio 2017 Installer, go to 'Individual Components'and select Windows 8.1 SDK
. Go back to to the project > Right click and Re-target to match the SDK required as shown below:
我也遇到了这个问题。重新运行Visual Studio 2017 安装程序,转到“单个组件”并选择Windows 8.1 SDK
. 返回到项目>右键单击并重新定位以匹配所需的SDK,如下所示:
回答by estellezg
I installed the 8.1 SDK's version:
我安装了 8.1 SDK 的版本:
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
It used 1GB (a little more) in the installation.
它在安装中使用了 1GB(多一点)。
回答by Pavel
Another way (worked for 2015) is open "Install/remove programs" (Apps & features), find Visual Studio, select Modify. In opened window, press Modify, check
另一种方法(适用于 2015 年)是打开“安装/删除程序”(应用程序和功能),找到 Visual Studio,选择修改。在打开的窗口中,按修改,检查
Languages -> Visual C++ -> Common tools for Visual C++
Windows and web development -> Tools for universal windows apps -> Tools (1.4.1) and Windows 10 SDK ([version])
Windows and web development -> Tools for universal windows apps -> Windows 10 SDK ([version])
Languages -> Visual C++ -> Common tools for Visual C++
Windows and web development -> Tools for universal windows apps -> Tools (1.4.1) and Windows 10 SDK ([version])
Windows and web development -> Tools for universal windows apps -> Windows 10 SDK ([version])
and install. Then right click on solution -> Re-target and it will compile
并安装。然后右键单击解决方案->重新定位,它将编译
回答by Michael Bahig
I had win10 SDK and I only had to do retarget and then I stopped getting this error. The idea was that the project needs to upgrade its target Windows SDK.
我有 win10 SDK,我只需要重新定位,然后我就不再收到这个错误了。这个想法是该项目需要升级其目标 Windows SDK。
回答by yyater97
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"
安装所需版本的 Windows SDK 或在项目属性页中更改 SDK 版本
或者
通过右键单击解决方案并选择“重定向解决方案”
If you do visual studio guide, you will resolve the problem.
如果你做visual studio guide,你会解决这个问题。
回答by Reese Jones
I realize this post is a few years old, but I just wanted to extend this to anyone still struggling through this issue.
我意识到这篇文章已经有几年了,但我只是想将其扩展到仍在努力解决此问题的任何人。
The company I work for still uses VS2015 so in turn I still use VS2015. I recently started working on a RPC application using C++ and found the need to download the Win32 Templates. Like many others I was having this "SDK 8.1 was not found" issue. i took the following corrective actions with no luck.
我工作的公司仍然使用VS2015,所以我仍然使用VS2015。我最近开始使用 C++ 开发 RPC 应用程序,发现需要下载 Win32 模板。像许多其他人一样,我遇到了“找不到 SDK 8.1”的问题。我采取了以下纠正措施,但没有运气。
- I found the SDK through Micrsoft at the following link https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/as referenced above and downloaded it.
- I located my VS2015 install in Apps & Features and ran the repair.
- I completely uninstalled my VS2015 and reinstalled it.
- I attempted to manually point my console app "Executable" and "Include" directories to the C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1 and C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools.
- 我通过 Micrsoft 在以下链接https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ 上找到了 SDK ,并下载了它。
- 我在应用程序和功能中找到了我的 VS2015 安装并进行了修复。
- 我完全卸载了我的 VS2015 并重新安装了它。
- 我试图手动将我的控制台应用程序“可执行文件”和“包含”目录指向 C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1 和 C:\Program Files (x86)\Microsoft SDKs\Windows\v8 .1A\bin\NETFX 4.5.1 工具。
None of the attempts above corrected the issue for me...
上面的尝试都没有为我纠正这个问题......
I then found this article on social MSDN https://social.msdn.microsoft.com/Forums/office/en-US/5287c51b-46d0-4a79-baad-ddde36af4885/visual-studio-cant-find-windows-81-sdk-when-trying-to-build-vs2015?forum=visualstudiogeneral
Finally what resolved the issue for me was:
最后为我解决问题的是:
- Uninstalling and reinstalling VS2015.
- Locating my installed "Windows Software Development Kit for Windows 8.1" and running the repair.
- Checked my "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1" to verify the "DesignTime" folder was in fact there.
- Opened VS created a Win32 Console application and comiled with no errors or issues
- 卸载并重新安装VS2015。
- 找到我安装的“适用于 Windows 8.1 的 Windows 软件开发工具包”并运行修复。
- 检查我的“C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1”以验证“DesignTime”文件夹是否确实存在。
- 打开 VS 创建了一个 Win32 控制台应用程序并且编译没有错误或问题
I hope this saves anyone else from almost 3 full days of frustration and loss of productivity.
我希望这能让其他人免于近 3 天的沮丧和生产力损失。
回答by CAD bloke
Grep the folder tree's *.vcxproj
files. Replace <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
with <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
or whatever SDK version you get when you update one of the projects.
Grep 文件夹树的*.vcxproj
文件。当您更新项目之一时,替换<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
为<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
或您获得的任何 SDK 版本。