Compile error C2146 & C4430 when including DShow.h

Hi all. Here is a description of my problem;

I'm using Visual Studio 2005 Beta 2 to compile some C++ code taken from the book i'm working through at the moment, MSPress: Programming DirectShow for Digital Video and TV. I have narrowed the problem to being due to the '#include "DShow.h"' directive. A simple working hello world app fails to compile as soon as DShow.h is included....

The compile time error is the following;

Error    1    error C2146: syntax error : missing ';' before identifier 'PVOID64'    c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h    222
Error    2    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h    222   
Error    3    error C2146: syntax error : missing ';' before identifier 'Buffer'    c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h    5932   
Error    4    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h    5932

If it is of use here is my compiler comand line as given by the project properties of the IDE;

/Od /I "C:\Program Files\DirectX 9.0 SDK\Include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /GS- /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt


I'm really at a loss with this one, google isn't showing me anything useful either which is the source of many answers (unfortunately not this one....). Thanks for any help you can give on this,

Ben


Answer this question

Compile error C2146 & C4430 when including DShow.h

  • AngryTree

    Just more information here, the environment setting is attached here:

    Environment Space
       
     _ACP_ATLPROV=C:\Program Files\Microsoft Visual Studio 8\VC\Bin\ATLProv.dll _ACP_INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include;C:\DXSDK\Include;C:\DXSDK\Samples\C++\Common\Include;C:\DXSDK\Samples\C++\DirectShow\BaseClasses;C:\Program Files\OpenCV\filters\ProxyTrans;C:\Program Files\OpenCV\otherlibs\highgui;C:\Program Files\OpenCV\cxcore\include;C:\Program Files\OpenCV\cvaux\include;C:\Program Files\OpenCV\cv\include;C:\Program Files\Intel\plsuite\include;C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include _ACP_LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\DXSDK\Lib;C:\DXSDK\Lib\x86;C:\Program Files\OpenCV\otherlibs;C:\Program Files\OpenCV\lib;C:\Program Files\Intel\plsuite\lib\msvc;C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\i386;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;C:\Program Files\Microsoft Visual Studio 8\;C:\Program Files\Microsoft Visual Studio 8\lib _ACP_PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\tools;C:\Program Files\Microsoft Visual Studio 8\Common7\ide;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\;C:\Program Files\Microsoft Visual Studio 8\\SDK\v2.0\bin;C:\WINDOWS\SysWow64;;C:\DXSDK\Utilities\Bin\x86;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\OpenCV\bin; ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\cai\Application Data CommonProgramFiles=C:\Program Files\Common Files 

    Please help.
    Thank you.
    Sheldon



  • Emmersko

    Hi Benwhit,
      It would be great if you make sure that you are using the PSDK headers before the DirectX SDK ones. The compiler option /showIncludes should show from where the included files are coming from (specially basetsd.h).

    Here is a related post that might be helpful as well:
    http://forums.microsoft.com/msdn/ShowPost.aspx PostID=72027

    Thanks,
      Ayman Shoukry
      VC++ Team.

  • ErickLopez

    Thank you very much. putting the PSDK includes infront of the DirectX ones enables me to compile just fine again.

    Back to work on the video capturing :) many thanks.

    Ben

  • mossay

    Hi benwhit, i have the same problem.
    I got problens when with DShow.h 

    how can i see the switch compiler /showincludes, how does it work

    I also don't know how to put the PSDK includes in front of the Directx.
    where can I find the PSDK Includes

    I'm trying to capture video from satelitie,  just as you did.
     
    best regards..

    Renato

  • LegacyOfHerot

    Hello kind people

    I tried to compile the directshow base classes by using visual studio 2005 and got the error 2146 and 4430 as following.


    1>Note: including file:     c:\DXSDK\include\basetsd.h
    1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    ...........
    1>Note: including file:     c:\program files\microsoft visual studio 8\vc\platformsdk\include\basetsd.h

    I noticed that basetsd.h has been call twice and PSDK one should be called first and the DXSDK one should be called later. (from previos posts ). I changed the order in the include directory list and made sure PSDK is on the top of the list and followed by DXSDK include directory.

    However, it seems that I still get the same problem.

    Anything I am missing
    Help please.

    Sheldon

  • Compile error C2146 & C4430 when including DShow.h