将应用程序从 vs2005 升级到 vs2012 后的构建问题 [英] Build Issues after Upgrading app from vs2005 to vs2012

查看:25
本文介绍了将应用程序从 vs2005 升级到 vs2012 后的构建问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将我的应用程序从 Visual Studio 2005 IDE 升级到 Visual Studio 2012.升级向导成功转换解决方案和项目文件,错误为 0,警告很少.

I need my application to be upgraded from visual studio 2005 IDE to visual studio 2012 . The upgradation wizard converts the solution and project files successfully with 0 errors and few warnings.

但是当我开始构建应用程序时,我收到错误消息:

But when i start building the application i get error message :

error C1189: #error : 这个文件要求 _WIN32_WINNT 至少被定义为 0x0403.推荐值 0x0501 或更高.在 atlcore.h 中!

error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended. in atlcore.h !

我尝试将版本号更改为 0x0500、0x0501、0x0502 和 0x0601(通过/D 编译器选项和在 atlcore.h 中手动更改,WINVER 也更改.)但没有运气.正在显示相同的错误.

I tried changing the version no to 0x0500 , 0x0501 , 0x0502 and also 0x0601 ( both through /D compiler option and manually changing in atlcore.h , WINVER is also changed. ) but no luck . the same error is being displayed.

我哪里出错了?

推荐答案

Visual C++ 不再支持面向 Windows 95、Windows 98、Windows ME 或 Windows NT.如果您的 WINVER 或 _WIN32_WINNT 宏被分配给这些版本的 Windows 之一,您必须修改这些宏.

Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, or Windows NT. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros.

要修改宏,请在头文件中添加以下几行.

To modify the macros, in a header file, add the following lines.

#define WINVER 0x0500
#define _WIN32_WINNT 0x0500

WINVER 确定构建应用程序所需的最低平台 SDK,进而在编译时确定头文件找到哪些例程.

WINVER determines the minimum platform SDK required to build your application, which in turn will determine at compile time which routines are found by the headers.

#define _WIN32_WINNT_NT4     0x0400
#define _WIN32_WINNT_WIN2K     0x0500
#define _WIN32_WINNT_WINXP     0x0501
#define _WIN32_WINNT_WS03     0x0502
#define _WIN32_WINNT_WIN6     0x0600
#define _WIN32_WINNT_VISTA     0x0600
#define _WIN32_WINNT_WS08     0x0600
#define _WIN32_WINNT_LONGHORN    0x0600
#define _WIN32_WINNT_WIN7     0x0601

其他解决方案:

如果您在 PC 上安装了 WINdows SDK(在/Microsoft SDKs/Windows 中),您可以在 stdafx.h 中(或在您包含在所有 C++ 文件中的头文件中)#include.包括 SDKDDKVer.h 将针对可用的最高 Windows 版本.

If you have installed a WIndows SDK on your PC (in /Microsoft SDKs/Windows), you can #include in stdafx.h (or in a header you include in all your C++ files). Including SDKDDKVer.h will target the highest Windows version available.

希望它有效!!!!!!

Hopefully It work!!!!!

有关详细信息请参阅此处

这篇关于将应用程序从 vs2005 升级到 vs2012 后的构建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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