windwos 7和vs2010 c++ 下编译工程,出现错误fatal error C1189(VC6升VS2010时出现)
2013-10-07 01:47
489 查看
windwos 7和vs2010 c++ 下编译工程,
出现错误
fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.
是出c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h(35)中报出。
请问怎样解决?
解决办法:
===================================
下面是彻底解决方法:
在工程的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.
#endif
出现错误
fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.
是出c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h(35)中报出。
请问怎样解决?
解决办法:
===================================
下面是彻底解决方法:
在工程的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.
#endif
相关文章推荐
- windwos 7和vs2010 c++ 下编译工程,出现错误fatal error C1189
- 使用VS 2008(带sp1)编译VC 6.0的一个工程,出现下面的编译错误
- VC6工程转移至VS2008编译WinMain出现错误
- HXSafeGuard工程通过VS2010编译未安装VS2008出现以下错误
- 关于VC2008编译出现错误“error C2664: ” 的处理方法:
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- VS2010编译时出现错误1 error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- VC中在VS2008编译环境下创建属性表单中出现“所属资源不存在的错误”
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- VS 2005 打开 VC 6.0 工程,编译出现 cannot open file libc.lib
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- 我把一个VC6的工程转换为VS2008的工程后,编译总是出现找不到而且不能升级vc90.pdb文件的问题,error C2471--解决办法
- VS2010中程序编译生成都是正确的,直接生成的exe也是正确的,就是在VS中运行出现错误
- cmake 编译opencv 出现 The C++ compiler "C:/Program Files/Microsoft Visual Studio 10.0/VC/bin/cl.exe
- vc编译出现错误:cannot open program database 目录/debug/vc60.pdb的解决
- 使用VC2005编译出现这个错误
- 【mfc】vc++ 使用64位平台编译,运行程序出现0xc000007b错误的解决方案
- VC6调用VC2005编译生成的lib/dll库出现“unresolved external symbol "__declspec(dllimport) int __cdecl”错误的原因
- cocos2d-x 在IDE vs2010 出现error C2146: 语法错误: 缺少“;”(在标识符“PVOID64”的前面)编译错误解决方案