views:

90

answers:

3

I'm trying to implement http://msdn.microsoft.com/en-us/library/dd377634%28v=VS.85%29.aspx on Qt, to generate a poster frame/thumbnail for video files.

I have installed both Windows Vista and Windows 7 SDK. I put:

#include "qedit.h"

in my code (noting there is also one in C:\Qt\2010.04\mingw\include), I add:

win32:INCLUDEPATH += $$quote(C:/WindowsSDK/v6.0/Include)

to my *.pro file. I compile and get " error: sal.h: No such file or directory". Finding this in VC++ I add

win32:INCLUDEPATH += $$quote(C:/Program Files/Microsoft Visual Studio 10.0/VC/include)

And now have 1400 compile errors. So, I abandon that and just add:

win32:LIBS += C:/WindowsSDK/v7.1/Lib/strmiids.lib

to my *.pro file and try to run (without including any headers):

IMediaDet mediadet;

But then I get "error: IMediaDet: No such file or directory".

#include "qedit.h"

gives me the same error (it looks like it's pointing to the Qt version) and

#include "C:/WindowsSDK/v6.0/Include/qedit.h" 

goes back to generating 1000's of compile errors.

Sigh, so much trouble for what should be 10 lines of code...

Thanks for your comments and help

A: 
Fred
I don't have the external (Windows DirectShow) source, just the *.lib and qedit.h header, as well as dll's found on the net like Interop.DexterLib.dll
DaveO
+1  A: 

Since you say you are "a C++/Qt newbie" then I suspect that the real issue may be that you are attempting to load the library yourself rather than simply linking your application to it?

To link an external library into your application with Qt all you need to do is modify the appropriate .pro file. For example if the library is called libfoo.dll you just add

LIBS += -L/path/to/lib -lfoo

You can find more information about this in the relevant section of the qmake manual. Note that qmake commonly employs Unix-like notation and transparently does the right thing on Windows.

Having done this you can include the library's headers and use whatever classes and functions it provides. Note that you can also modify the project file to append an include path to help pick up the headers eg.

INCLUDEPATH += /path/to/headers

Again, more information in the relevant section of the qmake manual.

Note that both these project variables work with relative paths and will happily work with .. to mean "go up a directory" on all platforms.

Troubadour
+1  A: 

Note that qedit.h requires dxtrans.h, which is part of DirectX9 SDK.

You can find dxtrans.h in DirectX SDK from August 2006. Note that dxtrans.h is removed from newer DirectX SDKs.

Cristian Adam
I find it amusing that it was easier for me to cross compile FFmpeg on Linux and use avcodec.dll to create thumbnails than get the Windows API working in Qt. Anyhow, I'll return to this when space and speed becomes and issue. Thanks for your comment!
DaveO
Microsoft has deprecated DirectShow and DirectShow Editing Services (qedit.h is part of DES). For example on Windows Server 2008 (normal and R2) qedit.dll is not present.When you have the right SDKs programming DirectShow works as expected :)
Cristian Adam