Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I'm getting this error in VS 2010, seems to happen alot out there.

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

Tried this before my includes. Didn't work.
#define _WIN32_WINNT 0x403

Any other suggestions out there?
Thank you.
Posted

Haha, sorry but have you actually read what you've written?

requires _WIN32_WINNT to be #defined at least to 0x0500 - so required: _WIN32_WINNT >= 0x500

Tried this before my includes. Didn't work.
#define _WIN32_WINNT 0x403
- so _WIN32_WINNT == 0x403

0x403 < 0x500

see http://msdn.microsoft.com/en-us/library/aa383745(v=vs.85).aspx[^] for _WIN32_WINNT values
 
Share this answer
 
v3
Comments
Member 7766180 1-Oct-11 19:45pm    
So, would I replace it with _WIN32_WINNT_WIN7 (0x0601)in the afxcomctl32.h header or cam I just put it at the start of my cpp file? Thanks.
Simon Bang Terkildsen 1-Oct-11 19:51pm    
well it should really be in your StdAfx.h header, but sure putting your define before the include of afxcomctl32.h in your cpp file should work
When you use
C++
#define _WIN32_WINNT 0x0403
you are saying you want to target Windows NT 4.0 SP3 or higher. But Visual Studio can only target Windows XP or higher for which you need to use
C++
#define _WIN32_WINNT 0x0501
or higher. So the header used by Visual Studio 2010 can not handle the value 0x0403.
 
Share this answer
 
Comments
Member 7766180 1-Oct-11 19:40pm    
But I put #define _WIN32_WINNT 0x0403 after I got error. I read that this was the way to fix that error. At least now I know what that line means. But how do you fix it in Win7 and VS2010.
André Kraak 1-Oct-11 19:43pm    
Use the _WIN32_WINNT value of the minimum OS you are targeting, see http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx as provided by Simon.
If you are targeting Windows 7 and higher use the value 0x0601. If you use any OS specific functionality it will mean your application will not run on lower OS versions.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900