简体   繁体   中英

getting rid of _WIN32_WINNT not defined.

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

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 :

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM