Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows SDK Version setting in Visual Studio 2017

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?

like image 665
athos Avatar asked Dec 14 '17 10:12

athos


People also ask

How do I choose Windows SDK version?

Open the shortcut menu for the project node, and choose Retarget projects. (In earlier versions of Visual Studio, choose Retarget SDK Version.) The Review Solution Actions dialog appears. In the Target Platform Version dropdown list, choose the version of the Windows SDK you want to target.

What is Windows 10 SDK in Visual Studio?

The Windows SDK (10.0. 22621) for Windows 11, version 22H2 provides the latest headers, libraries, metadata, and tools for building Windows applications. Use this SDK to build Universal Windows Platform (UWP) and Win32 applications for Windows 11, version 22H2 and previous Windows releases.

Does Visual Studio need Windows SDK?

The Visual Studio SDK (Software Development Kit) is an optional feature in Visual Studio setup. You can also install the VS SDK later on.

Does Visual Studio need Windows 10 SDK?

It is not necessary if you limit yourself to what is possible with standard C++ (console-only output, using the C++ standard library, etc). If you don't know, but have in mind "I just want my applications to have a windows interface" then you need the windows SDK. Well, technically, you don't need the SDK.


1 Answers

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

like image 162
Luis Avatar answered Oct 24 '22 12:10

Luis