Problem to get start with QuickTime SDK in C++ application.

sanscsansc Registered User
edited April 2007 in Hog 4 Tips and Tricks
Hi,
Im new to QuickTime.Now i need to use quicktime7.1 SDK functionalities in my plain C++ application.Hence I started with a plain C++ application just to check whether i can access the quick time functions there.Im currently using Dev-cpp IDE for developing my application.

Given the sample code.

#include<iostream>
#include<conio.h>
#include<QuickTime.h>
using namespace std;

main()
{
int ver=0;
ver=quicktime_major(void);
cout<<"VERSION"<<ver;
getch();
}

The given program uses the quicktime function quicktime__major to get the version information.The function returns an integer value,which is the version of the quicktime installed.The function is declared with in the header quicktime.h.Hence i added the header file.

On Compiling,I am getting some errors in the main function as listed :-

main.cpp: In function `int main()':
main.cpp:9: error: expected primary-expression before "void"
main.cpp:9: error: `quicktime_major' undeclared (first use this function)
main.cpp:9: error: (Each undeclared identifier is reported only once for each function it appears in.)make.exe: *** [main.o]

Error 1Execution terminated


I am getting so many other errors in the quicktime header files which i am not able to get resolved.Some sample errors are

listed below.
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:145: error: conflicting declaration 'kATSULineWidthTag'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:145: error: 'kATSULineWidthTag' has a previous declaration as

`<anonymous enum> kATSULineWidthTag'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:145: error: declaration of `kATSULineWidthTag'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:145: error: conflicts with previous declaration `<anonymous enum>

kATSULineWidthTag'


[this same error is repeating for all the enum members in the header file ATSUnicode.h ]



C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h: In function `OSStatus (* NewATSQuadraticLineUPP(OSStatus (*)(const

Float32Point*, const Float32Point*, void*)))(const Float32Point*, const Float32Point*, void*)':
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2523: error: redefinition of `OSStatus (*

NewATSQuadraticLineUPP(OSStatus (*)(const Float32Point*, const Float32Point*, void*)))(const Float32Point*, const

Float32Point*, void*)'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2523: error: `OSStatus (* NewATSQuadraticLineUPP(OSStatus (*)(const

Float32Point*, const Float32Point*, void*)))(const Float32Point*, const Float32Point*, void*)' previously defined here

C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h: In function `OSStatus (* NewATSQuadraticCurveUPP(OSStatus (*)(const

Float32Point*, const Float32Point*, const Float32Point*, void*)))(const Float32Point*, const Float32Point*, const

Float32Point*, void*)':
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2542: error: redefinition of `OSStatus (*

NewATSQuadraticCurveUPP(OSStatus (*)(const Float32Point*, const Float32Point*, const Float32Point*, void*)))(const

Float32Point*, const Float32Point*, const Float32Point*, void*)'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2542: error: `OSStatus (* NewATSQuadraticCurveUPP(OSStatus (*)(const

Float32Point*, const Float32Point*, const Float32Point*, void*)))(const Float32Point*, const Float32Point*, const

Float32Point*, void*)' previously defined here

C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2561: error: redefinition of `OSStatus (*

NewATSQuadraticNewPathUPP(OSStatus (*)(void*)))(void*)'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2561: error: `OSStatus (* NewATSQuadraticNewPathUPP(OSStatus

(*)(void*)))(void*)' previously defined here
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h: At global scope:C:/Program Files/QuickTime

SDK/CIncludes/ATSUnicode.h:2578: error: conflicting declaration 'uppATSQuadraticClosePathProcInfo'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2578: error: 'uppATSQuadraticClosePathProcInfo' has a previous

declaration as `<anonymous enum> uppATSQuadraticClosePathProcInfo'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2578: error: declaration of `uppATSQuadraticClosePathProcInfo'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2578: error: conflicts with previous declaration `<anonymous enum>

uppATSQuadraticClosePathProcInfo'
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h: In function `OSStatus (* NewATSQuadraticClosePathUPP(OSStatus

(*)(void*)))(void*)':
C:/Program Files/QuickTime SDK/CIncludes/ATSUnicode.h:2580: error: redefinition of `OSStatus (*

NewATSQuadraticClosePathUPP(OSStatus (*)(void*)))(void*)'

Can anyone help me to resolve the above issues.

Thanks in advance,
Sans

Comments

  • quinnquinn Registered User
    edited April 2007
    start over.

    trying to make calls to Carbon from Windows isn't pretty. so you're not gonna want to include QuickTime.h

    instead you need to:

    link in QTMLClient.lib
    inlcude QTML.h

    include only the headers you actually need to use (movies.h, Quickdraw.h, QuickTimeVR.h, etc...)

    sansc wrote:
    ver=quicktime_major(void);
    ok... i'm not sure i've ever heard of quicktime_major()... but since you're trying to pass it a void, i'm gonna make a strong suggestion: consider downloading (the free) Microsoft Visual Basic 2005 Express Edition and use it to program against the QuickTime COM objects.

    but if you really need to hit the API directly, here's how to snag a version:
    [SIZE=2][COLOR=#0000ff]
    int[/COLOR][/SIZE][SIZE=2] main( ) 
    
    {[INDENT]cout << [/INDENT][/SIZE][INDENT][SIZE=2][COLOR=#a31515]"Initializing QuickTime..."[/COLOR][/SIZE][SIZE=2];[/SIZE][INDENT][SIZE=2]InitializeQTML(0); cout << endl[/SIZE]
    [/INDENT][SIZE=2]<< [/SIZE][SIZE=2][COLOR=#a31515]"QuickTime Initialized."[/COLOR][/SIZE][SIZE=2][COLOR=#008000]/*...probably...*/[/COLOR][/SIZE][SIZE=2] << endl;
     
     
    [/SIZE][SIZE=2][COLOR=#0000ff]long[/COLOR][/SIZE][SIZE=2] version;
    Gestalt(gestaltQuickTime,&version);
     
     
    
    cout << endl << endl << [/SIZE][SIZE=2][COLOR=#a31515]"\tQuickTime Version: "[/COLOR][/SIZE][SIZE=2];[INDENT]cout.setf(ios::hex,ios_base::basefield);
    cout << version << endl << endl;
     
    
    [/INDENT]_getch();
    [COLOR=#0000ff]return[/COLOR] 0;[/SIZE]
    
    [/INDENT][SIZE=2]}[/SIZE]
    
Sign In or Register to comment.