最近拿到一个别人的工程,是使用VS.net创建的,而我的机器上只有vs2010,于是用自带的转换工具将它转换成vs2010的工程,转换之前我就很担心,怕转换完后会出问题,但是没有办法,我实在是不想再安一个vs.net了。

转完后果不其然真出了问题,在重新build工程时,报了一大堆错误,其中第一个就是“fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended”,然后看错误的来源,竟然是atlcore.h,这我就无语了,这是mfc自带的文件,出错的可能性基本上为0,于是只好去请教谷大叔,发现很多人都遇到了这个问题,看了几篇博客和帖子后,大概明白了,应该是_WIN32_WINNT这个宏对应定义的系统的版本号,如果太低的话,编译器就会认为代码无法在当前的系统上编译。

说了原因,下面是修改方法,就是在stdafx.h文件中修改相关的定义,修改完后的效果应该如下:

 
 
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
 
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
 
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0501 // Change this to the appropriate value to target Windows Me or later.
#endif
 
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0601 // Change this to the appropriate value to target IE 5.0 or later.
#endi

VS2010编译错: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403...的解决方法的更多相关文章

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

    说了原因,下面是修改方法,就是在stdafx.h文件中修改相关的定义,修改完后的效果应该如下: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #ifndef WINVER ...

  2. This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended

    VS2005转换成VS2010时出现的问题: This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x05 ...

  3. VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x

    下面是彻底解决方法:在工程的stdafx.h中添加(如有类似语句,需注释掉)#ifndef WINVER // Allow use of features specific to Windows 95 ...

  4. VC++ 2010编译错误 fatal error C1189 error This file requires _WIN32_WINNT to be #defined at least

    打开你的C++工程,找到里面的stdafx.h文件,然后把下面的红色内容替换成绿色的 参考:http://blog.csdn.net/dongliqiang2006/article/details/5 ...

  5. CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法

    1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...

  6. error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler op

    caffe c++11编译问题 问题:error: #error This file requires compiler and library support for the ISO C++ 201 ...

  7. 安装centos6.10时,安装完成重启报错error 15,file not found

    今天在一台老式联想服务器上安装centos6.10操作系统,安装完成,重启时,出现报错 error 15, file not found...... 在百度上搜索到进grub编辑,可还是无法解决问题, ...

  8. Gradle 同步时报错,Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha8的解决方法

    Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha8. 原因: SDK 中可能是没有安装 ...

  9. Android Studio下“Error:Could not find com.android.tools.build:gradle:2.2.1”的解决方法

    ref from: Android Studio下“Error:Could not find com.android.tools.build:gradle:2.2.1”的解决方法http://blog ...

随机推荐

  1. spring-security 理解 笔记 介绍以及使用(持续更新)

    本人经过2周的学习,成功搭建了认证服务器,资源服务器和客户端 .下面是本人对 oauth2的理解,以及spring-security的使用,如果理解错误的地方,还望指正. 现在代码有点凌乱,过段时间会 ...

  2. NodeJS+MongoDB+AngularJS+Bootstrap书店示例

    目录 一.Bootstrap 1.1.添加引用 1.2.在页面中使用BootStrap 1.3.可视化布局 二.使用MongoDB创建数据库 2.1.启动MongoDB数据库 2.2.启动数据库GUI ...

  3. java验证身份证号码是否有效源代码

    原文:http://www.open-open.com/code/view/1420373343171 1.描述 用java语言判断身份证号码是否有效,地区码.出身年月.校验码等验证算法 2.源代码 ...

  4. 教你如何查看CAD文件是哪个版本的来自http://blog.sina.com.cn/s/blog_4c9fa4dd0101il1v.html

    教你如何查看CAD文件是哪个版本的 http://blog.sina.com.cn/s/blog_4c9fa4dd0101il1v.html (2013-03-10 22:24:52) 转载▼ 标签: ...

  5. 【python】Python的字典get方法:从字典中获取一个值

    转自: http://blog.sina.com.cn/s/blog_6be89284010183xm.html

  6. HadoopMapReduce运行机制

    1.map方法读取一个文件的一行记录进行分析,  输入:LongWritable(当前读取的文件位置), Text(内容) 2.map将读取到的信息进行分类,输入Context  (键值对)  ;作为 ...

  7. spring理解一

    spring基本工作原理例如以下: 1.查找bean配置文件 2.载入bean配置文件并解析生成中间表示BeanDefinition 3.注冊beanDefinition 4.假设是单例或lazy-i ...

  8. iOS 开发小常识 开发笔记

    一   自定义push方法 /*  参数说明 *  controllerName : push的目标页 例:@“testcontroll”    ---注意不带.h *  isNibPage     ...

  9. 一个有意思的Ruby Webdriver超时问题的解决过程

    rescue in receive 由于写ruby的时候感觉混身上下都拽起来了,所以比較喜欢用ruby写代码. 今天遇到了一个webdriver timeout的问题,问题本身还是由于我对webdri ...

  10. 手机阅读行业SWOT分析

    上个星期,在公司内部的分享活动上给童鞋们分享了手机阅读行业现状,小伙伴儿们嗷嗷待哺的眼神促使我把PPT转换为博客里的文字和图片,再一次更加深入地进入手机阅读. 通过SWOT分析分析我们能够对手机阅读行 ...