With VS2010 I have this error:
error C1189: #error : NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
in StdAfx.h is use:
#define _WIN32_WINNT 0x0502
and in my other source my.cpp i use:
#define NTDDI_VERSION 0x06000000
How I can solve that?
#define NTDDI_VERSION 0x06000000
That is Vista.
#define _WIN32_WINNT 0x0502
That is Server 2003.
And so these versions are indeed conflicting. If you want to support Vista and up you'll need:
#define NTDDI_VERSION 0x06000000
#define _WIN32_WINNT 0x0600
If you want Server 2003 and up then you use:
#define NTDDI_VERSION 0x05020000
#define _WIN32_WINNT 0x0502
Note that the NTDDI_VERSION
define can also specify service packs. So if you want Vista SP1 and up then you use:
#define NTDDI_VERSION 0x06000100
#define _WIN32_WINNT 0x0600
As a general rule you want to set these defines to the value corresponding to the minimum version that you wish to support.
Rather than using these magic constants, you should write, for example:
#define NTDDI_VERSION NTDDI_VISTA
#define _WIN32_WINNT _WIN32_WINNT_VISTA
For more details refer to MSDN: Using the Windows Headers.
NTDDI_VERSION 0x06000000
is Windows Vista, so you need #define _WIN32_WINNT 0x0600
.
MSDN has the details you need right here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With