compiling MPStreamAnalyzer with VS2005 (1 Viewer)

FlexyZ

Portal Member
September 8, 2005
22
0
Hi All,

I am trying to compile filters\MPSA, but get an error (not really related to MP, but must be a way :)

I have installed the latest DirectX SDK, and also tried Oktober DX.

But "streams.h" is only in the "(Summer 2004) DX SDK)

Here is the error :

C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses\ctlutil.h 278

and on line 278 : "operator=(LONG);"

Also tried to compile with VS2003, but can't open project.

Thanks :)
 

Agree

Retired Team Member
  • Premium Supporter
  • September 7, 2005
    27
    0
    FlexyZ said:
    Really no help :( - could I be the only one with compiler problems :(

    FlexyZ

    You must get the PlatformSDK, setup it for your system, and compile the baseclasses.

    Greets
     

    FlexyZ

    Portal Member
    September 8, 2005
    22
    0
    Hi

    Also tried with the newest Platform SDK, I have "ctlutil.h" in the Platform SDK and DirectX 9.0 (Summer 2004)

    And the files are equal, still got this in "class COARefTime : public"

    private:
    // Prevent bugs from constructing from LONG (which gets
    // converted to double and then multiplied by 10000000
    COARefTime(LONG);
    operator=(LONG);
    };



    Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Program Files\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h 278

    Is there something missing in the project file?
     

    Agree

    Retired Team Member
  • Premium Supporter
  • September 7, 2005
    27
    0
    FlexyZ said:
    Hi

    Also tried with the newest Platform SDK, I have "ctlutil.h" in the Platform SDK and DirectX 9.0 (Summer 2004)

    And the files are equal, still got this in "class COARefTime : public"

    private:
    // Prevent bugs from constructing from LONG (which gets
    // converted to double and then multiplied by 10000000
    COARefTime(LONG);
    operator=(LONG);
    };



    Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Program Files\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h 278

    Is there something missing in the project file?

    Check if you get the right header files (set the path in VS folder settings).

    Greets
     

    draktheas

    Retired Team Member
  • Premium Supporter
  • December 17, 2005
    77
    2
    I had the same problem. It takes some significant digging and understanding of the new VS2005 compiler.

    There are a few compiler and linker problems if you attempt to build as you have with previous versions of the compiler. The first is that the compiler no longer puts a default value type of 'int' on any unspecified type declarations or function return types. So you will have to edit the BaseClasses source files to fix these problems. There are only two of them. One is:
    operator=(LONG);
    You will just need to change it to:
    COARefTime& operator=(LONG);
    The second is a variable being declared without a type, I don't remember the exact line and file, but you just need to make it a DWORD type.

    The second problem is the new compiler adheres to the proper (see the ANSI C++ standard) behavior for variables declared in a for loop, which the old compiler didn't. Whomever wrote the BaseClasses code for Directshow did not follow the standard, therefor the code no longer compiles. To fix this one you will need to go into the makefile in the BaseClasses directory and add:
    /Zc:forScope-
    to both of the $(CC) compiler call lines. This will turn off ANSI C++ compliance for the for scope declaration issues.

    Next you will want to make sure you are using the prescribed build method for the BaseClasses source. I just built a little batch file that does it all for me. Here is what it looks like (note: you will need to put this in the BaseClasses directory and replace my VS install path with yours):

    call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
    call "..\..\..\..\setenv.cmd" /XP32 /DEBUG
    nmake /A

    call "..\..\..\..\setenv.cmd" /XP32 /RETAIL
    nmake /A

    xcopy /Y .\XP32_DEBUG\strmbasd.lib ..\..\..\..\Lib\strmbasd.lib
    xcopy /Y .\XP32_RETAIL\strmbase.lib ..\..\..\..\Lib\strmbase.lib

    Secondary note: you may need to change this batch file further if you are targetting a different platform than 32Bit XP. Take a look at the setenv.cmd file in the PlatformSDK root for more options.

    Drak
     

    FlexyZ

    Portal Member
    September 8, 2005
    22
    0
    Hi Drak,

    Thanks a lot

    After some digging I found the resolution in ctlutils :

    COARefTime& operator=(LONG);

    But then had other trouble, but I will try to do it your way :)

    Thanks again :)
     

    Agree

    Retired Team Member
  • Premium Supporter
  • September 7, 2005
    27
    0
    FlexyZ said:
    Hi Drak,

    Thanks a lot

    After some digging I found the resolution in ctlutils :

    COARefTime& operator=(LONG);

    But then had other trouble, but I will try to do it your way :)

    Thanks again :)

    Guys, just simply make sure u had the right lib and include pathes on the right position (mostly the first search pathes should be those from the platform sdk and directx sdk) in vs 2005 folder options. (and yeah, the position in the list matters)

    why that complicated?

    greets
     

    Users who are viewing this thread

    Top Bottom