Chinaunix首页 | 论坛 | 博客
  • 博客访问: 256176
  • 博文数量: 71
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 920
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-16 13:07
个人简介

我喜欢蓝天,也喜欢雨天。

文章分类

全部博文(71)

文章存档

2014年(14)

2013年(57)

分类: C/C++

2013-11-29 10:15:35

看网上下载的代码,自己用vs2010打开,生成一个solution ,编译的时候出现错误:
Error 1 error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended. c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h 35
双击错误定位到atlcore.h的一下语句:
#if _WIN32_WINNT < 0x0403
#error This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.
#endif
因为搞不懂,上网查一查,有人说预编译加一句#define _WIN32_WINNT 0x0501,但是试了,还是不行。然后又查到一下方法。
首先看看工程中是否包含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

接下来,在stdafx.h中包含这个文件 #include "targetver.h".编译一下没有错误。
至于为什么出现这个错误,以及问什么这么解决,暂时还不清楚。

阅读(2509) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~