windwos 7和vs2010 c++ 下编译工程,出现错误fatal error C1189
2011-10-12 14:22
387 查看
mx17 等 级: |
添加:#define _WIN32_WINNT 0x0501
可以解决那个报错,但是又出来另外的报错了,不过楼上各位的方法给了我一个思路
下面是彻底解决方法:
在工程的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
#15楼 得分:0回 |
applemacosx (applemacosx) 等 级: | #23楼 得分:0回复于:2011-08-29 22:58:26 |
#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>
以后大家遇到这个问题就新建一个h文件,把上面的代码复制进去,然后在工程的stdafx.h的顶部添加 include"targetver.h",记得删除所有类似下面的代码:
#ifndef WINVER // 允许使用 Windows 95 和 Windows NT 4 或更高版本的特定功能。
#define WINVER 0x0400 //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
#endif
#ifndef _WIN32_WINNT // 允许使用 Windows NT 4 或更高版本的特定功能。
#define _WIN32_WINNT 0x0400 //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
#endif
#ifndef _WIN32_WINDOWS // 允许使用 Windows 98 或更高版本的特定功能。
#define _WIN32_WINDOWS 0x0410 //为 Windows Me 及更新版本改变为适当的值。
#endif
#ifndef _WIN32_IE // 允许使用 IE 4.0 或更高版本的特定功能。
#define _WIN32_IE 0x0400 //为 IE 5.0 及更新版本改变为适当的值。
#endif。再编译,所有问题都解决了。
相关文章推荐
- windwos 7和vs2010 c++ 下编译工程,出现错误fatal error C1189(VC6升VS2010时出现)
- HXSafeGuard工程通过VS2010编译未安装VS2008出现以下错误
- DSP中由C转成C++出现编译 badly formed pragma错误的解决.
- c++ clr编译dll在c#调用时出现“试图加载不正确的格式”“找不到dll”错误的解决
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- 解决VS2010创建工程时弹出“创建或打开C++浏览数据库文件 发生错误”的问题"
- vs2012编译2012工程时出现 failure during conversion to coff file invalid or corrupt 错误解决
- .NET下编译C++代码时出现fatal error C1083: 无法打开包括文件:“xuhk_JNIHelloWorld.h”: No such file or directory错误的解决方法。
- VS2010中程序编译生成都是正确的,直接生成的exe也是正确的,就是在VS中运行出现错误
- 【网络SOCKET编程】DEV-C/C++ 编译时出现undefined reference to `WSAStartup@8'等错误解决办法
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- cocos2d-x 在IDE vs2010 出现error C2146: 语法错误: 缺少“;”(在标识符“PVOID64”的前面)编译错误解决方案
- xarmain使用Forms编译android工程出现support_r19.0.1.zip支持包错误
- .NET下编译C++代码时出现"error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int"错误的解决方法。
- VC6工程转移至VS2008编译WinMain出现错误
- 用xcode6.3编译早期工程时出现Undefined symbols for architecture x86_64错误的解决办法(转)
- C++编译过程常出现的错误
- VS2010出现FileTracker : error FTK1011编译错误的解决办法
- DirectShow 在VS2005/VS2010中环境配置和编译运行出现 winnt.h(5940)错误问题的解决