安装VS2008后,在winnt.h中出现编译错误 [英] After installing VS2008, I get a compile error in winnt.h

查看:31
本文介绍了安装VS2008后,在winnt.h中出现编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我们的项目从 VS2005 转移到 VS2008,并且在 MFC 项目上遇到此构建错误:

I'm trying to move our project over to VS2008 from VS2005 and am running in to this build error on an MFC project:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h(236) : error C2146: syntax error : missing ';' before identifier 'PVOID64'

我认为这是 SDK 问题或某些论坛建议的包含目录排序问题,但这似乎不是问题.有没有人见过这个?当我试图追踪这个时,我应该寻找什么?

I thought this was an SDK issue or an include directory ordering issue as some forums have suggested but that doesn't seem to be the problem. Has anyone seen this before? What should I be looking for when trying to track this down?

我还想知道是否需要在我的项目的 stdafx 中增加 WINVER 预处理器标志.他们已经很老了:

I'm also wondering if I need to increase the WINVER preprocessor flags in my project's stdafx. They are pretty old:

#ifndef WINVER              
#define WINVER 0x0500       
#endif

#ifndef _WIN32_WINNT        
#define _WIN32_WINNT 0x0500
#endif                      

#ifndef _WIN32_WINDOWS  
#define _WIN32_WINDOWS 0x0510 
#endif

#ifndef _WIN32_IE           
#define _WIN32_IE 0x0500    
#endif

谢谢

推荐答案

这只发生在包含 DirectShow 包含文件的项目中.问题是有一个 Basetsd.h,它是 DirectShow SDK 的一部分,在包含 Windows SDK 的 Basesd.h 之前被包含.DirectShow 版本没有定义 POINTER_64(因为它是旧的)然后导致我报告的问题.

This only happens in projects that include DirectShow include files. The problem is that there is a Basetsd.h that is part of the DirectShow SDK that is being included prior to the inclusion of the Windows SDK's Basetsd.h. The DirectShow version doesn't define POINTER_64 (because it's old) and then causes the problem I reported.

解决方案是在违规项目的添加包含设置中将包含目录添加到SDK中.如:

The solution is to add the include directory to the SDK in the offending project's addition includes setting. As in:

"$(WindowsSdkDir)\include"

这开始发生在我从 VS2005 升级到 VS2008 之后,因为以前,SDK 包含指令被指定为:

This started happening after I upgraded to VS2008 from VS2005 because previously, the SDK include directive was given as:

"$(VCInstallDir)PlatformSDK\include"

VS2008中不再是平台SDK的位置

Which is no longer the location of the platform SDK in VS2008

这篇关于安装VS2008后,在winnt.h中出现编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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