Is Qt 5.0.1 supposed to be compiled with GCC 4.8.0 ?



  • Hi

    I tried to compile Qt with MinGW 4.8.0 rev1 from mingwbuilds project. Dependencies compiled fine. (Including OpenSSL, ICU, Freetype, Fontconfig) But Qt itself didn't. I got some errors when mingw32-make compiles ODBC driver. There are redefined symbols:

    @
    g++ -c -pipe -fno-keep-inline-dllexport -g -fno-exceptions -frtti -Wall -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_
    PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"........\include" -I"........\include\QtSql" -I"........\include\QtSql\5.0.1" -I"........\include\QtSql\5.0
    .1\QtSql" -I"........\include\QtCore" -I".moc\debug_shared" -I"C:\mingw64\include" -I"........\mkspecs\win32-g++" -o .obj\debug_shared\main.o main.cpp
    In file included from C:\mingw64\include/sql.h:19:0,
    from ../../../sql/drivers/odbc/qsql_odbc.h:66,
    from main.cpp:44:
    C:\mingw64\include/sqltypes.h:65:0: warning: "CALLBACK" redefined [enabled by default]
    #define CALLBACK
    ^
    In file included from c:\mingw64\x86_64-w64-mingw32\include\windows.h:69:0,
    from ........\include/QtCore/../../src/corelib/global/qt_windows.h:66,
    from ........\include/QtCore/qt_windows.h:1,
    from ../../../sql/drivers/odbc/qsql_odbc.h:49,
    from main.cpp:44:
    c:\mingw64\x86_64-w64-mingw32\include\windef.h:81:0: note: this is the location of the previous definition
    #define CALLBACK __stdcall
    ^
    In file included from C:\mingw64\include/sql.h:19:0,
    from ../../../sql/drivers/odbc/qsql_odbc.h:66,
    from main.cpp:44:
    C:\mingw64\include/sqltypes.h:87:29: error: conflicting declaration 'typedef short int TCHAR'
    typedef signed short TCHAR;
    ^
    In file included from c:\mingw64\x86_64-w64-mingw32\include\windef.h:139:0,
    from c:\mingw64\x86_64-w64-mingw32\include\windows.h:69,
    from ........\include/QtCore/../../src/corelib/global/qt_windows.h:66,
    from ........\include/QtCore/qt_windows.h:1,
    from ../../../sql/drivers/odbc/qsql_odbc.h:49,
    from main.cpp:44:
    c:\mingw64\x86_64-w64-mingw32\include\winnt.h:218:17: error: 'TCHAR' has a previous declaration as 'typedef WCHAR TCHAR'
    typedef WCHAR TCHAR, *PTCHAR;
    ^
    In file included from C:\mingw64\include/sql.h:19:0,
    from ../../../sql/drivers/odbc/qsql_odbc.h:66,
    from main.cpp:44:
    C:\mingw64\include/sqltypes.h:105:26: error: conflicting declaration 'typedef short unsigned int WCHAR'
    typedef unsigned short WCHAR;
    ^
    @

    Is there any plan to add patches for 4.8.0 or maintain compatibility with the new compiler in 5.0.2 or 5.1.0 ?



  • I just noticed that conflicts are relared to headers of unixODBC. Is unixODBC required for compiling Qt in Windows with MinGW? I think it's necessary for PSQL...


  • Moderators

    Qt 5.0.1 is older than GCC 4.8, so it was obviously not released with GCC 4.8 compatibility in mind. Some issues with GCC 4.8 have been found: http://lists.qt-project.org/pipermail/development/2013-March/010587.html



  • I would like to know what is wrong with GCC 4.8 that makes Qt incompatible with it ? I just compiled Qt with 4.8 and it looks fine.

    It would be nice if Qt has a automated test suite for framework itself...


  • Moderators

    I'm not sure of the details -- it's something to do with how the compiler handles template specialization.

    This patch allowed Qt 5 to be compiled with GCC 4.8: https://codereview.qt-project.org/#change,48831 It arrived too late to make it into Qt 5.0.2, but it will be in Qt 5.1



  • So why I am able to compile Qt 5 with 4.8 ? And why it works ?
    I suppose if there is some compiler-level issues, then should be failures in binary generation, else if there is some ABI-level issue, it will compile but won't work under certain circumstances. Later one is more much more bigger trouble I think. (correct me if I'm wrong)

    I will run auto test suits provided withing source, and post results here


  • Moderators

    Someone reported that compilation will succeed on Linux if C++11 support is disabled, but not if you enable C++11: http://qt-project.org/forums/viewthread/26362/

    Again, I'm unfamiliar with the internals. If you want to know the details, ask on the Development mailing list: http://lists.qt-project.org/mailman/listinfo/development



  • AFAIK the -c++11 option has problems even with 4.7.x

    After all, 4.8 compiles Qt 5.0.1 and everything looks fine.


  • Moderators

    A bit late, but since I stumbled across this post ... Qt 4.8 isn't compiled with -c++11 option by default, that's why it's not affected.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.