Results 1 to 5 of 5

Thread: Cannot compile in Suse. OK with mingw and studio 2005 on Windows XP.

  1. #1
    Join Date
    Aug 2007
    Location
    SW London, UK
    Posts
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Cannot compile in Suse. OK with mingw and studio 2005 on Windows XP.

    Program compiles in Studio 2005 and with mingw on Windows so I think it has to be something to do with how qmake works in Linux.

    I'm using qt 4.3.3 on Suse Linux 10.3 (have tried earlier versions also).

    Previous version of the program compiled OK on both Windows and Linux. I have added cImg template libarary and also a custom widget (modelled on the icon editor in C++ GUI Programming with Qt4)

    Other people (not here, I don't think) seem to have had the problem and one of the suggestions I tried was a hack that #undefs the offending items. That did not seem to make any difference and, in any case, would not be a very good fix to my way of thinking!

    Many thanks in advance.


    Errors as follows (4.3.2 version - 4.3.3 is similar)

    cd '/home/david/Neo/Neo' && gmake
    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.3.2/include/QtCore -I/usr/local/Trolltech/Qt-4.3.2/include/QtGui -I/usr/local/Trolltech/Qt-4.3.2/include -I. -o Column.o Column.cpp
    In file included from /usr/local/Trolltech/Qt-4.3.2/include/QtCore/qmetatype.h:46,
    from /usr/local/Trolltech/Qt-4.3.2/include/QtCore/qvariant.h:45,
    from /usr/local/Trolltech/Qt-4.3.2/include/QtCore/QVariant:1,
    from ui_MPF.h:13,
    from InOut.h:25,
    from NeoRegion.h:26,
    from Column.h:27,
    from Column.cpp:24:
    /usr/local/Trolltech/Qt-4.3.2/include/QtCore/qdatastream.h:46:2: error: #error qdatastream.h must be included before any header file that defines Status
    In file included from /usr/local/Trolltech/Qt-4.3.2/include/QtCore/qvariant.h:45,
    from /usr/local/Trolltech/Qt-4.3.2/include/QtCore/QVariant:1,
    from ui_MPF.h:13,
    from InOut.h:25,
    from NeoRegion.h:26,
    from Column.h:27,
    from Column.cpp:24:
    /usr/local/Trolltech/Qt-4.3.2/include/QtCore/qmetatype.h:50:2: error: #error qmetatype.h must be included before any header file that defines Bool
    Last edited by jpn; 28th December 2007 at 19:55. Reason: missing [quote] tags

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Cannot compile in Suse. OK with mingw and studio 2005 on Windows XP.

    Quote Originally Posted by zotric View Post
    error: #error qdatastream.h must be included before any header file that defines Status
    error: #error qmetatype.h must be included before any header file that defines Bool
    Have you tried doing what's being suggested - switching the order of includes? Try including Qt headers first and external lib headers afterwards.
    J-P Nurmi

  3. #3
    Join Date
    Aug 2007
    Location
    SW London, UK
    Posts
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cannot compile in Suse. OK with mingw and studio 2005 on Windows XP.

    Well I had some vague idea about this but they are not my headers are they?
    I would need to change the build files which would not be ideal.
    However, unless anyone comes up with anything else I'll certainly have a go.

    It seems to me that qmake should be able to work out what order to include the headers.
    Have I misunderstood something?
    Thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Cannot compile in Suse. OK with mingw and studio 2005 on Windows XP.

    Well, I don't know what is "cImg template libarary" but aren't you including its headers somewhere in your program?

    What I meant was to change:
    Qt Code:
    1. // somefile.cpp
    2. #include <some_cImg_header> // currently, cImg is included first and then
    3. #include <some_Qt_header> // something from Qt after is included afterwards
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. // somefile.cpp
    2. #include <some_Qt_header> // include stuff in reverse order so that qdatastream.h and qmetatype.h
    3. #include <some_cImg_header> // won't get mixed up about stuff defined in cImg header
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Cannot compile in Suse. OK with mingw and studio 2005 on Windows XP.

    I'm using qt 4.3.3 on Suse Linux 10.3 (have tried earlier versions also).
    Do you mean earlier versions of Suse or Qt?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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.