PDA

View Full Version : DirectX and Qt with MinGW



QCasper
30th August 2007, 13:32
I wrote some code using DirectShow and Qt 4.3.1 Open Source Edition. After compiling using MinGW (WindowsXP SP2) I got a lot of errors. Frequently occuring of them looks like this:

c:/Program Files/PlatformSDK/Include/winbase.h:1576: error: declaration of C function `LONG InterlockedIncrement(volatile LONG*)' conflicts with d:/Qt/4.3.1/include/QtCore/../../src/corelib/arch/qatomic_windows.h:190: error: previous declaration `long int InterlockedIncrement(long int*)' here

Is this mean that this version of Qt is not compatible with DirectShow (or COM entirely)? Or any ideas how to fix?

wysota
30th August 2007, 14:31
Try changing the order of include statements.

QCasper
30th August 2007, 14:56
Try changing the order of include statements.

I think that is not a solution because even this code compiling with same errors:

// main.cpp

#include <dshow.h>

int main(int argc, char *argv[]) {
return 0;
}

// test.pro

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += . "C:\Program Files\PlatformSDK\Include"

# Input
SOURCES += main.cpp

compile command is "qmake && make release"

wysota
30th August 2007, 15:24
This doesn't seem related to Qt then. I don't see any Qt includes here. Are you sure this is the code that gets compiled?

QCasper
30th August 2007, 15:31
This doesn't seem related to Qt then. I don't see any Qt includes here. Are you sure this is the code that gets compiled?

Yes, there are no Qt includes in code, but when I call qmake, it creates a makefile with this line:

INCPATH = -I"..\..\Qt\4.3.1\include\QtCore" -I"..\..\Qt\4.3.1\include\QtCore" -I"..\..\Qt\4.3.1\include\QtGui" -I"..\..\Qt\4.3.1\include\QtGui" -I"..\..\Qt\4.3.1\include" -I"." -I"c:\Program Files\PlatformSDK\Include" -I"..\..\Qt\4.3.1\include\ActiveQt" -I"release" -I"." -I"..\..\Qt\4.3.1\mkspecs\win32-g++"

and yet there we can see Qt includes.

wysota
30th August 2007, 19:09
But none of them are used (these are just directories where the compiler should look for includes), thus there are no Qt includes... If the compiler complains about Qt includes, you must be compiling some code that actually uses a Qt include.