MFC does not support WINVER less than 0x0501

By default WINVER is defined as 0x0500 in preprocessor. To overcome from this error, remove defined win version "WINVER=0x0500" from Configuration Properties => c/c++ => Preprocessor tab and rebuild.

Or you can provide higher WIN VERSION as #define _WIN32_WINNT 0x601 in your code wherever you getting error.


I got the same error, on Windows 7 with Visual Studio 2013.

In my case my project had a source file with name stdafx.h, inside that file there was

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif

I changed it to

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x601
#endif

and the error disappeared.


All MFC apps define the WINVER macro value somewhere if you didn't define it yourself. I assume MS has removed the definition by default on its own header files and is now making mandatory that you explicitly define it.

So, to solve your problem, either put the #define in your 'preprocessor' compiler options, or at the top of your precompiled header (ie stdafx.h).

Note 0x501 is Windows XP support. 0x600 is Vista, 0x601 is Windows 7 — and how sad am I for remembering that!