Click here to Skip to main content
11,921,889 members (60,908 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++
I am getting this error
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
I was already defined this _WIN32_WINNT in Preprocessor definitions as
why i am still getting this error?
please reply me.
Posted 25-Apr-11 2:29am
Richard MacCutchan 25-Apr-11 10:54am
On reflection, and based on your comment below, I suspect you have added this to your Project properties. However, it is likely that you added it to the properties of the Debug build but not the Release one.
Albert Holguin 25-Apr-11 21:11pm
good catch, but he shouldn't define there anyway, so your solution is better :)
Richard MacCutchan 26-Apr-11 3:47am
I'm just trying to cover all the bases. :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The correct format for the define is
#define _WIN32_WINNT 0x0502
and this statement must come before any #includes in the StdAfx.h, or whatever include you use to build the precompiled headers.
vallikelam 25-Apr-11 9:04am
My code is working in debug mode but in release mode it shows like that why
Albert Holguin 25-Apr-11 10:20am
debug must be ignoring your invalid macro statement all together
Richard MacCutchan 25-Apr-11 10:30am
We cannot guess what is happening, please post the code you are using (edit your original question above, and add the detail there).
Albert Holguin 25-Apr-11 10:20am
my 5
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi, vallikelam.
Go through this link

, this will help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 568
1 Dave Kreskowiak 285
2 Sergey Alexandrovich Kryukov 173
3 Richard MacCutchan 155
4 ppolymorphe 135
0 OriginalGriff 7,036
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,286
3 George Jonsson 2,840
4 Suvendu Shekhar Giri 2,216

Advertise | Privacy | Mobile
Web01 | 2.8.151120.1 | Last Updated 25 Apr 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100