Qt5 build on windows with MinGW; “off64_t” error [SOLVED]



  • When I want to build Qt 5.1.1 with mingw32-make (version "GNU Make 3.82.90", gcc version "4.8.1") I get the below error. (Actually the same error occured to the gcc 4.7.x) . I wonder if, somehow, the config script thought I wanted to compile for win64 ?! But I checked, it downloaded the standard mingw-get and did an update afterwards.
    For configuration I used

    @configure -nomake examples -nomake tests -opengl desktop -platform win32-g++@

    I have Python 2.7, Perl 5.18.1 and Ruby 2.0.0 installed, as well. Any ideas on that ?

    @In file included from ....\mkspecs\win32-g++/qplatformdefs.h:56:0,
    from access\qhttpnetworkreply_p.h:55,
    from access\qhttpnetworkreply.cpp:42:
    c:\mingw\include\io.h:301:14: error: 'off64_t' does not name a type
    __CRT_INLINE off64_t lseek64 (int, off64_t, int);
    ^
    c:\mingw\include\io.h:302:14: error: 'off64_t' does not name a type
    __CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {
    ^
    Makefile.Debug:8219: recipe for target '.obj/debug_shared/qhttpnetworkreply.o' failed
    mingw32-make[4]: *** [.obj/debug_shared/qhttpnetworkreply.o] Error 1
    mingw32-make[4]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase/src/network'
    Makefile:38: recipe for target 'debug-all' failed
    mingw32-make[3]: *** [debug-all] Error 2
    mingw32-make[3]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase/src/network'
    Makefile:182: recipe for target 'sub-network-make_first' failed
    mingw32-make[2]: *** [sub-network-make_first] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase/src'
    Makefile:41: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: *** [sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase'
    Makefile:56: recipe for target 'module-qtbase-make_first' failed
    mingw32-make: *** [module-qtbase-make_first] Error 2@



  • This building problem seems to be caused by a MinGW bug:
    http://sourceforge.net/p/mingw/bugs/2024/

    So, one solution for the time being is to edit io.h of the MinGW distribution. Replace (line 301 and 302):
    @__CRT_INLINE off64_t lseek64 (int, off64_t, int);
    __CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence)@
    with
    @__CRT_INLINE _off64_t lseek64 (int, _off64_t, int);
    __CRT_INLINE _off64_t lseek64 (int fd, _off64_t offset, int whence)@
    i.e. replace all occurences of off64_t with _off64_t



  • Now I'm having the following error, will keep you tuned on this:
    @In file included from ....\include/QtGui/qopenglversionfunctions.h:1:0,
    from kernel\qopenglcontext.h:63,
    from kernel\qwindow.cpp:49:
    ....\include/QtGui/../../src/gui/opengl/qopenglversionfunctions.h:785:43: error: expected unqualified-id before ')' token
    void (QOPENGLF_APIENTRYP MemoryBarrier)(GLbitfield barriers);
    ^
    Makefile.Debug:19676: recipe for target '.obj/debug_shared/qwindow.o' failed
    mingw32-make[4]: *** [.obj/debug_shared/qwindow.o] Error 1
    mingw32-make[4]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase/src/gui'
    Makefile:38: recipe for target 'debug-all' failed
    mingw32-make[3]: *** [debug-all] Error 2
    mingw32-make[3]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase/src/gui'
    Makefile:310: recipe for target 'sub-gui-all' failed
    mingw32-make[2]: *** [sub-gui-all] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase/src'
    Makefile:44: recipe for target 'sub-src-all' failed
    mingw32-make[1]: *** [sub-src-all] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/5.1.1_32_mingw/qtbase'
    Makefile:59: recipe for target 'module-qtbase-all' failed
    mingw32-make: *** [module-qtbase-all] Error 2@



  • This is a qt bug, see
    http://stackoverflow.com/questions/18739688/compile-time-error-from-a-qt-file-expected-unqualified-id-before-token

    setting to [SOLVED] since the original problem was solved. Anyways, I'm open to ideas on the Qt5.1.1 problem


Log in to reply
 

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