fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0500. Value 0x0501 or higher is recommended.

Today i upgraded my Visual Studio 2008 MFC app to Visual Studio 2010 and got the following error message when i compiled it for the first time

[code]

fatal error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0500.

Value 0x0501 or higher is recommended.

[/code]

After figuring out the problem i would like to share it with you guys so it might save some of your precious time

Open stdafx.h file in your visual studio project and change to below values to fix the problem

[code]

#ifndef WINVER
#define WINVER 0x0501
#endif

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif

#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0501
#endif

#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif

[/code]

Let me know if you find it useful

Get Free Email Updates!

Signup now and receive free offers, discounts & coupon codes

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge