views:

150

answers:

2

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'

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?

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

Thanks

A: 

You should try removing those WINVER macros from your stdafx.h. Those versions (5.0 and 5.1) predate Win64, so they probably don't have the declaration for PVOID64.

Michael
A: 

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.

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

"$(WindowsSdkDir)\include"

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

"$(VCInstallDir)PlatformSDK\include"

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

Karim