3

I'm trying to get rid of the _WIN32_WINNT not defined:

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

I'm running VS 2010 on Win 7 and am trying to recompile a MFC project orginally complied in Win CE.

I've had a look at WinSDKVer.h and can see what its going on about but I can't figure out where WIN32_WINNT is being defined/set in the first place.

The $(OS) is set to Windows_NT if i look under the macro section of pre-prosessor definitions but i can't change it. Not sure if thats anything to do with it?

Any thoughts?

Many Thanks

1 Answers1

9

Two possible fixes:

At the top of your precompiled header file (typically stdafx.h). Make this the first header to be included.

#include <SDKDDKVer.h>

That will probably clear things up for you.

Alternatively, you can just define _WIN32_WINNT to something reasonable in your preprocessor settings. Right-click on Project name in Solution Explorer and select "Properties..."

From the Properties dialog, go to Configuration Properties -> C/C++ -> Preprocessor

In the list for Preprocessor defintiions, add an entry for _WIN32_WINNT=0x0600:

selbie
  • 100,020
  • 15
  • 103
  • 173
  • +1. For more details of how these Windows header macros are expected to be defined and how they interact: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx – Adrian McCarthy Apr 23 '15 at 15:40