首页 > Windows开发 > 详细

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

时间:2015-05-06 13:21:33      阅读:501      评论:0      收藏:0      [点我收藏+]

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

VS2003的工程转换成VS2010后编译报错。

定位到afxcomctl32.h文件,这是系统文件没有做任何更改,主要还是版本兼容性问题。

修改方法:

新建一个targetver.h头文件,复制以下代码:

#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>


然后在工程的stdafx.h的顶部添加 include"targetver.h"。

重新编译即可。


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

原文:http://blog.csdn.net/xiao_lxl/article/details/45533361

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!