Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting rid of _WIN32_WINNT not defined.

Tags:

c++

mfc

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 Answers

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:

like image 71
selbie Avatar answered Dec 10 '25 01:12

selbie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!