Reputation: 6425
I have a c++ project that compiles well under Visual Studio 2013. Today I installed Visual Studio 2017 Professional Edition, then there's a new setting in project settings > General called "Windows SDK Version", by default is 10.0.16299.0. Since I'm compiling windows desktop programs for targeting Windows 7 systems, I changed it to 8.1, is this correct?
Upvotes: 7
Views: 14573
Reputation: 1235
Generally speaking, a Windows SDK supports its "main" version and also the previous ones, but you need to specify what Windows version your program will need. In fact, you're better off doing so or else you can inadvertently use features not available in the version you want to support.
Given an SDK, you indicate which older Windows version to target by defining the WINVER and _WIN32_WINNT macros somewhere in your project files or in the C/C++ Preprocessor project settings in Visual Studio.
For example, the following definitions target Windows 7:
#define WINVER 0x0601
#define _WIN32_WINNT 0x0601
For more information, see Using the Windows Headers and Modifying WINVER and _WIN32_WINNT
Upvotes: 5
Reputation: 193
Indeed I raised this issue because my freshly installed Visual Studio could not build the VM because SDK 16299 is now indeed the default. It's mentioned here: https://en.wikipedia.org/wiki/Microsoft_Windows_SDK. . Also MS does not make finding older SDK's very easy. You have to click through to another page all the way on the end of this page: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk Even though I googled on "Microsoft Windows SDK 15063". . So all-in-all it's now a small chore for newbies to get up and running on the VM. To start, I think it should be made as easy as possible. (Complexity will come soon after that :)). . PS I'm not sure about Windows 7 compatibility. But the current VM SDK is also listed as being for Windows 10.
Upvotes: 3