4

I get the message

_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)

from every cpp file.

I tried adding the following to the main file before any headers (got this from here

#define _WIN32_WINNT 0x05010000 //I want to support XP

and I still get these messages for different cpp files. Any suggestions on how I could stop these messages from displaying I am using VS2012

Community
  • 1
  • 1
MistyD
  • 16,373
  • 40
  • 138
  • 240

1 Answers1

1

The constant you want to define is _WIN32_WINNT not _WIN32_WINNT_MAXVER. The possible values are listed here: http://msdn.microsoft.com/en-us/library/aa383745%28VS.85%29.aspx

You should define it before including windows.h.

Retired Ninja
  • 4,785
  • 3
  • 25
  • 35
  • I just updated the post. Do i need to do this in very cpp file ? – MistyD Dec 06 '13 at 03:02
  • You need it before every #include of windows.h. Usually that would be one place only: in stdafx.h – ScottMcP-MVP Dec 06 '13 at 03:07
  • The value you are using isn't appropriate for that constant, you should use one from the table at the link I provided. The value you're using would be if you decide to define `NTDDI_VERSION` which also requires that you define `_WIN32_WINNT`. As @ScottMcP-MVP said, you need to define these before including `windows.h` anywhere you include it. If you use a precompiled header than that's most likely the right spot. – Retired Ninja Dec 06 '13 at 03:14