MFC不支持小于0x0501的WINVER [英] MFC does not support WINVER less than 0x0501

查看:1029
本文介绍了MFC不支持小于0x0501的WINVER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++项目,该项目引用了许多其他项目/库.这适用于许多年前创建的应用程序.大约每年一次,它进行更新并完成一个新版本.多年来,我一直使用Visual Studio 6来更新和构建此应用程序的新版本,而没有任何问题.

I have a C++ project that references many other projects/libraries. This is for an application that was created many years ago. About every once a year it is updated and a new version is done. I've used Visual Studio 6 to update and build new versions of this app for years now without any problems.

我正在尝试切换到Visual Studio 10(以及现在的VS2013).最初,由于VS版本之间的兼容性问题,我遇到了一些警告和错误.我能够照顾大多数人.但是,我仍然对以下错误感到困惑:

I am trying to switch to Visual Studio 10 (and now VS2013). Initially I ran into several warnings and errors which were due to compatibility issues between the VS versions. I was able to take care of most. However, I'm still somewhat confused by the following error:

error C1189: #error : MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header. C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxv_w32.h

该错误在一些引用的项目库中发生.我检查了有问题的项目库,但找不到任何关于WINVER的引用.

The error occurs in a few of the referenced project libraries. I checked the project libraries in question and I cant find any reference to WINVER.

我已经在互联网上搜索了有关此问题的信息,但发现了一些主题,但没有发现与我的问题有关的任何内容.有人可以阐明这里可能发生的情况吗?

I have searched the internet for info on this and found some topics but nothing that is specific to my problem. Can someone shed some light as to what might be happening here?

先谢谢了. 洛杉矶

推荐答案

如果您自己没有定义WINVER宏值,则所有MFC应用程序都会在其中定义WINVER宏值.我假设MS默认已在其自己的头文件中删除了该定义,现在强制您明确定义它.

All MFC apps define the WINVER macro value somewhere if you didn't define it yourself. I assume MS has removed the definition by default on its own header files and is now making mandatory that you explicitly define it.

因此,要解决您的问题,请将#define放在预处理器"编译器选项中,或放在预编译头文件(即stdafx.h)的顶部.

So, to solve your problem, either put the #define in your 'preprocessor' compiler options, or at the top of your precompiled header (ie stdafx.h).

注意0x501是Windows XP支持. 0x600是Vista,0x601是Windows 7-我为记住这一点而感到难过!

Note 0x501 is Windows XP support. 0x600 is Vista, 0x601 is Windows 7 — and how sad am I for remembering that!

这篇关于MFC不支持小于0x0501的WINVER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆