Error MSB8036: The windows SDK version 10.0.17763.0 was not found - c++

OS: Windows 10 64bit
Platform: Visual Studio 2019
I'm compiling C++ DLL project.
Although I installed "Windows 10 SDK (10.0.17763)" and "Visual Studio SDK", the visual studio can"t see the SDK.
I try to "Retarget Solution" but there is no list of Windows SDKs.
The WindowsSdkDir, WindowsSdkDir_10 environment variables are empty.
How do I get the Visual Studio 2019 to detect the installation of the Windows SDK and associate it to my project

Usually you can select a specific Windows SDK (exact version) or "newest" SDK in your project properties (right click, properties).
I think your project uses some specific Windows SDK Version which is not installed on your machine. To make your project Windows SDK-version independent you should go to the properties page and select "Windows 10 SDK (newest)" - or similar

Related

Why do I get "Illegal Instruction" error when Building on windows10 and running on Windows7

I have a c++ program built using VS2017 on windows7.
When I run it on Windows7 or windows10 there is no problem.
If I Build the same program on Windows10 (still using VS2017) the program runs OK on Windows10 but when I try to run it on Windows7 I get an "0xC000001D: Illegal Instruction." error.
Is it even possible to run programs built in Windows10 on Windows7 ? and if so what can I do?
Thanks
The default SDKs will be different on your two VS2017 installations. Right-click the project, select "properties", then the "General" page. See Windows SDK Version.
You can install different SDK versions (and different Platform Toolsets) using the Visual Studio installer ("Modify").
You would probably need to install the v140 toolset.
Also see the response here:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/e19634d8-f635-4ed0-b8d7-45b64ccbd6fa/windows-sdk-7-in-visual-studio-2017?forum=visualstudiogeneral
...which states:
You can create a project with the default project template. After that, right click the project name under Solution Explorer and go to Configuration Properties-General, modify the 'Platform Toolset' to Windows7.1SDK, since you already installed the Windows SDK 7. Please have a look at the following note:
##To change the target platform toolset, you must have the associated version of Visual Studio or the Windows Platform SDK installed. For example, to target the Itanium platform with the Windows7.1SDK platform toolset, you must have Microsoft Windows SDK for Windows 7 and .NET Framework 4 SP1 installed
If the above not works, you can also modify the platform toolset to Visual Studio 2010 (v100), which has the same compiler like Windows SDK 7, if you have the VS 2010 and VS 2017 on the same computer

Visual studio platform toolset vs Windows SDK

Why does Microsoft visual studio has different configuration properties for settings 'Windows SDK' and 'platform toolset' in same project?
I have the understanding that every windows SDK provides new/different version of platform toolset.
So how does it make sense to specify platform toolset of say Windows 10 SDK and at the same time setting the SDK option to say Windows 8.1 SDK in the same project?
Very confusing.
Accoding to the Doc
For the Windows target platform, Windows SDK Version specifies the
version of the Windows SDK that your project requires.
Platform Toolsetallows the project to target a different version of
the Visual C++ libraries and compiler. Visual Studio C++ projects can
target either the default toolset installed by Visual Studio, or one
of the toolsets installed by several previous versions of Visual
Studio, including toolsets that create executables that can run on
Windows XP.
"I have the understanding that every windows SDK provides new/different version of platform toolset"
The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Platform Toolset is related to visual studio version. For example :
Visual Studio 2015: v140
Visual Studio 2017: v141
Visual Studio 2019: v142
Windows SDK is related to windows version. For example:
Windows SDK(10.0.18362.0):Windows 10, version 1903
Windows SDK(8.1): Windows 7 or Windows Vista

How can I set up Visual Studio 2017 to develop drivers?

According to this forum, https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/windows-wdk-on-visual-studio-2017-community/fdbd2b44-e57a-4849-903d-04001205a764
Windows Driver Kit is not currently supported by visual studio 2017.
I tried installing the Windows Driver Kit, but the test driver projects, such as this one, fail to build
https://github.com/Microsoft/Windows-driver-samples/tree/master/serial/VirtualSerial
I get this error when building:
Error MSB8020 The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
I already tried retargeting the Solution to the two options I have: 10.0.17134.0 and 8.1, but the same error keeps coming up.
What do I need to do to build this sample driver? Do I need to install VS2015? VS2017 community edition? Why isn't this WDK supported by the Visual Studio 2017 professional version?
Thanks,
Visual Studio 2017 definitely supports kernel-mode device driver development; there's no doubt about that because I've been using VS17 for it for many, many months.
Use the latest version of Windows Driver Kit (WDK) which can be downloaded and installed from MSDN: https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
Furthermore, you can always use the Enterprise WDK and then you can simply build using that if you wanted to from command-line. (Also can be found on page linked-to above)
Download the correct WDK installer for your edition of Visual Studio 2017:
WDK for Windows 10, version 1809 for Visual Studio Community 2017
WDK for Windows 10, version 1803 for Visual Studio Professional 2017
WDK for Windows 10, version 1709 for Visual Studio Enterprise 2017
Visit https://learn.microsoft.com/en-us/windows-hardware/drivers/other-wdk-downloads for more information.
Not exactly a solution, but Windows 8.1 WDK works with Visual Studio 2017 Enterprise,
Download it from here, just need to retarget the project to 8.1
https://www.microsoft.com/en-us/download/confirmation.aspx?id=42273
In addition, I needed to get VS2015 C++ Build Tool to fix a missing Microsoft.cpp.props error
http://download.microsoft.com/download/5/F/7/5F7ACAEB-8363-451F-9425-68A90F98B238/visualcppbuildtools_full.exe
Developing drivers to windows is quite interesting one will be exposed to advanced Operating System Concepts.The set up for the environment will be IDE
IDE - Visual Studio (https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16)
Compilers (WDK)
Debugger (WDK)
WDK contains both(https://go.microsoft.com/fwlink/?linkid=2085767). Latest Visual Studio(VS2019) will come along with the latest WDK(10, 1903 as of now).
Sometimes plugins might not work properly i.e integration issues between Visual Studio and WDk.
By going to the location "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019" and run VSIX installer.
Now in a new project, driver related templates are available.

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.
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.
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.
When I try to build a DirectX project in VS2017, I get the error:
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? Specifically to use VS2017 shader debugging functionality.
Thanks,
EDIT:
Under VS2017 - Tools -> Get Tools and Features
I have checked
Game Development with C++
and under Optional I have
C++ Profiling tools
Windows 10 SDK (10.0.17134.0)
I'm downloading 16299.0, this fixed the first error of not having the right SDK.
But now I get the runtime error Failed Creating the Direct3D device when running in Debug. I can still run samples in Release
The error message shows which SDK you need:
The Windows SDK version 10.0.16299.0 was not found
So the SDK for Windows 10 Fall Creators Update 1709 is missing and you downloaded the SDK for April 2018 Update (1803 Build 17134).
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:
You can download the required Windows SDK versions from Microsoft:
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
Just install the required version and the build should work.

Visual Studio 2015 RC Community Edition Target Platform set to Windows 10 TP on Windows 8.1

I just freshly installed Windows 8.1 and Visual Studio 2015 RC Community Edition.
The compilation of an existing c++ project failed, not finding <windows.h> for include. In order to fix that I installed Windows 8.1 SDK with no luck.
Looking into it my Project Settings for the "Win32" configuration says:
Why does VS2015 display Windows 10 as default target platform and why can't I change the value to Windows 8.1?
The installation of
Microsoft Visual Studio 2015 Tools for Windows 10 (Technical Preview)
and
Windows Software Development Kit - Windows 10.0.10069
seems to be done by default during Visual Studio 2015 RC setup.
The optional selection of Windows 8.1 and Windows Phone 8.0/8.1 Tools does not seem to install the respective Platform Toolsets properly alongside of the Windows X versions in order to be able to change that on the respective project settings page.
Uninstalling the above mentioned Tool- and SDK-Kits for Windows 10 made
Target Platform Windows
available in the Project Settings and I can choose Version 8.1 now.
Now <windows.h> is found again.
I had the same problem.
I changed the platform toolset to v140_xp, and closed VS2015. After opening VS2015 asked to install Windows XP C++ libraries, 225MB. After these steps my project was compiled successfully. Hope this helps you.