C++ : _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER

Hi,

How to get rid of the warning :
 _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)

project c++ visual studio v15 entreprise
Hassan NOUR EL DINEIT ManagerAsked:
Who is Participating?
 
David Johnson, CD, MVPOwnerCommented:
This is a warning, not an error, and is very common when upgrading a Visual C++ project. This is the macro that defines what the lowest version of Windows that our application will run on. If we ignore the warning, we accept the default value, _WIN32_WINNT_MAXVER, which means the current version of Windows. For a table of possible values, see Using the Windows Headers. For example, we can set it to run on any version from Vista onwards.

#define _WIN32_WINNT _WIN32_WINNT_VISTA  

If the code uses parts of the Windows API that aren't available on the version of Windows that you specify with this macro, you should see that as a compiler error

define it before including windows.h
source:https://msdn.microsoft.com/en-us/library/dn986835.aspx
1
 
Hassan NOUR EL DINEIT ManagerAuthor Commented:
Thanks. Short, simple and perfect aswer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.