PDA

View Full Version : Problem compiling Qt 4.7.0 code with d3d10.h



pogo11
29th September 2010, 19:49
Hi,

I'm currently porting an existing application from Qt 4.5.0 to Qt 4.7.0 and I am getting a ton of compile error.

When Qt stuff is included BEFORE d3d10.h, I get the following errors :


1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : error C2146: syntax error : missing ';' before identifier 'ID3D10DeviceChild'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : error C2146: syntax error : missing ';' before identifier 'ID3D10DeviceChild'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : error C2086: 'int ID3D10DeviceChild' : redefinition
1> C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(58) : see declaration of 'ID3D10DeviceChild'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(64) : error C2146: syntax error : missing ';' before identifier 'ID3D10DepthStencilState'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(64) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(70) : error C2146: syntax error : missing ';' before identifier 'ID3D10BlendState'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(70) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(76) : error C2146: syntax error : missing ';' before identifier 'ID3D10RasterizerState'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(76) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(82) : error C2146: syntax error : missing ';' before identifier 'ID3D10Resource'
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\d3d10.h(82) : warning C4091: '' : ignored on left of 'interface' when no variable is declared

and it goes on and on... This refers to the forward declarations in d3d10.h (BTW, I get the same errors whether it's the d3d10.h from Windows SDK or from Direct3D SDK) :



/* Forward Declarations */

#ifndef __ID3D10DeviceChild_FWD_DEFINED__
#define __ID3D10DeviceChild_FWD_DEFINED__
typedef interface ID3D10DeviceChild ID3D10DeviceChild;
#endif /* __ID3D10DeviceChild_FWD_DEFINED__ */


#ifndef __ID3D10DepthStencilState_FWD_DEFINED__
#define __ID3D10DepthStencilState_FWD_DEFINED__
typedef interface ID3D10DepthStencilState ID3D10DepthStencilState;
#endif /* __ID3D10DepthStencilState_FWD_DEFINED__ */


I don't think this is specific to d3d, as I get the same kind of errors in ocidl.h, that was also created by MIDL (not by me) and that uses the same kind of forward declaration.

What is Qt doing that creates those errors? Does anyone have a clue?

Thanks a lot in advance,

pogo11

Astronomy
30th September 2010, 13:08
Hi,
Do you already have tried?

1) Import App without importing old build settings
2) qmake
3) clean all
4) rebuild all

greetz A.

pogo11
12th October 2010, 23:20
Hi,

I've narrowed the problem down:



#include <QGLWidget>
#include <QtNetwork>

#include <d3d10.h>

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


This simple program reproduces the problem with qmake and VS 2005. I still don't know what the problem was, but I got rid of it by removing the <QtNetwork> include file in my project. I don't know if this shows a "bug" somewhere in Qt's (or Direct3D's) header files...

pogo11