Results 1 to 3 of 3

Thread: Problem compiling Qt 4.7.0 code with d3d10.h

  1. #1
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem compiling Qt 4.7.0 code with d3d10.h

    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) :

    Qt Code:
    1. /* Forward Declarations */
    2.  
    3. #ifndef __ID3D10DeviceChild_FWD_DEFINED__
    4. #define __ID3D10DeviceChild_FWD_DEFINED__
    5. typedef interface ID3D10DeviceChild ID3D10DeviceChild;
    6. #endif /* __ID3D10DeviceChild_FWD_DEFINED__ */
    7.  
    8.  
    9. #ifndef __ID3D10DepthStencilState_FWD_DEFINED__
    10. #define __ID3D10DepthStencilState_FWD_DEFINED__
    11. typedef interface ID3D10DepthStencilState ID3D10DepthStencilState;
    12. #endif /* __ID3D10DepthStencilState_FWD_DEFINED__ */
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    May 2009
    Location
    Vienna
    Posts
    91
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem compiling Qt 4.7.0 code with d3d10.h

    Hi,
    Do you already have tried?

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

    greetz A.

  3. #3
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem compiling Qt 4.7.0 code with d3d10.h

    Hi,

    I've narrowed the problem down:

    Qt Code:
    1. #include <QGLWidget>
    2. #include <QtNetwork>
    3.  
    4. #include <d3d10.h>
    5.  
    6. int main( int argc, char **argv )
    7. {
    8. return 0;
    9. }
    To copy to clipboard, switch view to plain text mode 

    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

Similar Threads

  1. Replies: 2
    Last Post: 9th January 2016, 10:38
  2. Replies: 0
    Last Post: 27th August 2010, 09:36
  3. problem compiling
    By mesman00 in forum Qt Programming
    Replies: 2
    Last Post: 13th August 2009, 19:49
  4. Compiling QT4 Code using cmake 2.6
    By Serenity in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2008, 19:04
  5. Problem in compiling
    By ja_sapienza in forum Qt Programming
    Replies: 7
    Last Post: 11th July 2008, 15:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.