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

VS2005转换成VS2010时出现的问题:

解决方法:打开stdafx.h文件修改如下:

注释掉:

//#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
//#define WINVER 0x0400 // 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 0x0400 // 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 0x0410 // 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 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
//#endif

新增加:

#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.
#endif

时间: 2025-01-09 13:34:28

This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended的相关文章

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

最近拿到一个别人的工程,是使用VS.net创建的,而我的机器上只有vs2010,于是用自带的转换工具将它转换成vs2010的工程,转换之前我就很担心,怕转换完后会出问题,但是没有办法,我实在是不想再安一个vs.net了. 转完后果不其然真出了问题,在重新build工程时,报了一大堆错误,其中第一个就是“fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Val

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

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

Cannot refer to a non-final variable file inside an inner class defined in a different method

java多线程学习:生产者和消费者 问题:Cannot refer to a non-final variable file inside an inner class defined in a different method如果定义一个局部内部类,并且局部内部类使用了一个在其外部定义的对象,为什么编译器会要求其参数引用是final呢?注意:局部内部类,包括匿名内部类. 自己写的生产和消费者的类遇到的问题, final Goods pru = new Goods();没有在Goods 前加fi

visual studio编译错误集(转)

1.error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 在项目属性->Configration Properties->C/C++->Command Line页面的Additional Options中加入/wd4430 2.error MSB3073: The command regsvr32 /s /c 解决办法 最近将VC2002 代码移植到VC2010,

error C1189以及warning MSB8012

今天在将一个VS2003的工程转化为VS2010的时候,出了一些问题. 首先是: fatal error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended. 其次是: warning MSB8012: TargetExt(.exe) 与 Linker 的OutputFile 属性值(.scr)不匹配. 针

VS编译常见错误枚举01

fatal error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended. 在stdafx.h 当中添加 #define _WIN32_WINNT 0x0501

vs升级c++项目遇到的一些问题

1.error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended. 在工程的stdafx.h中,改为如下配置: #ifndef WINVER #define WINVER 0x0501 #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #end

vc++笔记十一

一.LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 连接器LNK是通过调用cvtres.exe完毕文件向coff格式的转换的,所以出现这样的错误的原因就是cvtres.exe出现了问题. 在电脑里面搜索一下cvtres.exe,发现存在多个文件,使用最新的cvtres.exe替换老的文件就可以.替换之前记得备份一下,假设不正确,能够替换回来. 比如:我的电脑里面安装了vs2010,近期更新了系统.打了一些补丁.结果就出现这样的错误了.在电脑里面搜索发现 C:\Program Fi

The Portable Executable File Format from Top to Bottom(每个结构体都非常清楚)

The Portable Executable File Format from Top to Bottom Randy KathMicrosoft Developer Network Technology Group Created: June 12, 1993 Click to open or copy the files in the EXEVIEW sample application for this technical article. Click to open or copy t