VS BUG(4) error MSB8036: The Windows SDK version 10 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".
前言
程序员难免要与BUG打交道,本系列将记录自己在VS平台下代码调试过程中遇到的一些BUG,希望对大家遇到相关问题时,可以提供帮助。
一. BUG提示
1>------ 已启动生成: 项目: SoundTouch, 配置: Debug x64 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 10 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".
2>------ 已启动生成: 项目: soundstretch, 配置: Debug x64 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 10.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".
========== 生成: 成功 0 个,失败 2 个,最新 0 个,跳过 0 个 ==========
二. 分析解决
这种问题一般是编译的系统平台的问题,外部工程直接导入到自己系统的VS平台时常见的报错,以本项目为例,原工程是win10系统下的工程,而自己的电脑系统是win7,所以产生报错信息,不要紧张,到项目系统平台改过来即可。
点击工具栏“项目”中“属性”
常规中右边目标平台显示是win10,“目标版本平台”中点击下拉
只有8.1和<从父级或项目默认设置继承>
选择8.1,
点击“确定”,重新生成解决方案即可。
成功!
三. 小结
项目移植是比较常见的应用,有时候是版本需要集成某个功能,所以先借鉴一下原项目工程的思路和文件,编译成功后再进行移植到自己的工程项目,一不小心都会出现这种版本平台问题,如果工程对版本平台的库没有太高要求的话,还是可以移植成功的,如果确实需要的高版本的库,低版本恰好没有,可能就会编译不通过了。本文中项目有两个工程,所以是成功2个,即两个项目的平台都需要改过来。