Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compiling Qt from sources
Forum Update on Monday, May 27th 2025

Compiling Qt from sources

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 3 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ODБOï
    wrote on 8 Oct 2018, 07:34 last edited by
    #1

    I am trying to compile Qt 5.9.2 with mingw32

    windows 7 pro
    bison/flex/perl/python are avalable

    after 2 houres i have this, how to interpret this please ?

    g++ -c -fno-keep-inline-dllexport -DNDEBUG -DQT_IMAGE_DECODERS -DRAPIDJSON_HAS_STDSTRING=1 -D__QT__ -O3 -ftemplate-depth=1024 -fvisibility-inlines-hi
    den -fvisibility=hidden -D_WINDOWS -DNOGDI -DNOMINMAX -D_USE_MATH_DEFINES -DMBGL_USE_GLES2 -DMBGL_VERSION_REV=\"qt-v1.1.0\" -g -Og -std=c++1z -w -fex
    eptions -mthreads -DUNICODE -D_UNICODE -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I. -Ideps\a
    y\8fef1e9 -Ideps\any\8fef1e9\include -Ideps\boost\1.62.0 -Ideps\boost\1.62.0\include -Ideps/cheap-ruler/2.5.3 -Ideps/cheap-ruler/2.5.3/include -Ideps
    earcut\0.12.3 -Ideps\earcut\0.12.3\include -Ideps\geojson\0.4.0 -Ideps\geojson\0.4.0\include -Ideps\geojsonvt\6.2.1 -Ideps\geojsonvt\6.2.1\include -I
    eps\geometry\0.9.2 -Ideps\geometry\0.9.2\include -Ideps\kdbush\0.1.1-1 -Ideps\kdbush\0.1.1-1\include -Ideps/pixelmatch/0.10.0 -Ideps/pixelmatch/0.10.
    /include -Ideps\polylabel\1.0.3 -Ideps\polylabel\1.0.3\include -Ideps\protozero\1.5.2 -Ideps\protozero\1.5.2\include -Ideps\rapidjson\1.1.0 -Ideps\ra
    idjson\1.1.0\include -Ideps\shelf-pack\2.1.1 -Ideps\shelf-pack\2.1.1\include -Ideps\supercluster\0.2.2 -Ideps\supercluster\0.2.2\include -Ideps\uniqu
    _resource\cba309e -Ideps\unique_resource\cba309e\include -Ideps\variant\1.1.4 -Ideps\variant\1.1.4\include -Ideps\vector-tile\1.0.0-rc7 -Ideps\vector
    tile\1.0.0-rc7\include -Ideps\wagyu\0.4.3 -Ideps\wagyu\0.4.3\include -Iinclude -Iplatform\default -Iplatform\qt\include -Isrc -IC:\MyQt\qt-everywhere
    opensource-src-5.9.2\qtbase\include\QtNetwork\5.9.2 -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtNetwork\5.9.2\QtNetwork -IC:\MyQt\q
    -everywhere-opensource-src-5.9.2\qtbase\include\QtGui\5.9.2 -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtGui\5.9.2\QtGui -IC:\MyQt\q
    -everywhere-opensource-src-5.9.2\qtbase\include\QtSql\5.9.2 -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtSql\5.9.2\QtSql -IC:\MyQt\q
    -everywhere-opensource-src-5.9.2\qtbase\include\QtCore\5.9.2 -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtCore\5.9.2\QtCore -IC:\MyQ
    \qt-everywhere-opensource-src-5.9.2\qtbase\include -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtNetwork -IC:\MyQt\qt-everywhere-open
    ource-src-5.9.2\qtbase\include\QtGui -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtANGLE -IC:\MyQt\qt-everywhere-opensource-src-5.9.2
    qtbase\include\QtSql -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtbase\include\QtCore -I.moc\debug -IC:\MyQt\qt-everywhere-opensource-src-5.9.2\qtb
    se\mkspecs\win32-g++  -o .obj\debug\async_task.o platform\qt\src\async_task.cpp
    In file included from include/mbgl/util/run_loop.hpp:4,
                     from platform\qt\src\async_task.cpp:4:
    include/mbgl/actor/mailbox.hpp:26:10: error: 'recursive_mutex' in namespace 'std' does not name a type
         std::recursive_mutex receivingMutex;
              ^~~~~~~~~~~~~~~
    include/mbgl/actor/mailbox.hpp:26:5: note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    include/mbgl/actor/mailbox.hpp:6:1:
    +#include <mutex>
    
    include/mbgl/actor/mailbox.hpp:26:5:
         std::recursive_mutex receivingMutex;
         ^~~
    include/mbgl/actor/mailbox.hpp:27:10: error: 'mutex' in namespace 'std' does not name a type
         std::mutex pushingMutex;
              ^~~~~
    include/mbgl/actor/mailbox.hpp:27:5: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
         std::mutex pushingMutex;
         ^~~
    include/mbgl/actor/mailbox.hpp:31:10: error: 'mutex' in namespace 'std' does not name a type
         std::mutex queueMutex;
              ^~~~~
    include/mbgl/actor/mailbox.hpp:31:5: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
         std::mutex queueMutex;
         ^~~
    In file included from platform\qt\src\async_task.cpp:4:
    include/mbgl/util/run_loop.hpp:97:10: error: 'mutex' in namespace 'std' does not name a type
         std::mutex mutex;
              ^~~~~
    include/mbgl/util/run_loop.hpp:97:5: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    include/mbgl/util/run_loop.hpp:9:1:
    +#include <mutex>
    
    include/mbgl/util/run_loop.hpp:97:5:
         std::mutex mutex;
         ^~~
    include/mbgl/util/run_loop.hpp: In member function 'void mbgl::util::RunLoop::withMutex(std::function<void()>&&)':
    include/mbgl/util/run_loop.hpp:82:30: error: 'mutex' is not a member of 'std'
             std::lock_guard<std::mutex> lock(mutex);
                                  ^~~~~
    include/mbgl/util/run_loop.hpp:82:30: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    include/mbgl/util/run_loop.hpp:82:35: error: template argument 1 is invalid
             std::lock_guard<std::mutex> lock(mutex);
                                       ^
    include/mbgl/util/run_loop.hpp:82:42: error: 'mutex' was not declared in this scope
             std::lock_guard<std::mutex> lock(mutex);
                                              ^~~~~
    In file included from include/mbgl/util/run_loop.hpp:105,
                     from platform\qt\src\async_task.cpp:4:
    include/mbgl/util/work_task_impl.hpp: At global scope:
    include/mbgl/util/work_task_impl.hpp:46:10: error: 'recursive_mutex' in namespace 'std' does not name a type
         std::recursive_mutex mutex;
              ^~~~~~~~~~~~~~~
    include/mbgl/util/work_task_impl.hpp:46:5: note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    include/mbgl/util/work_task_impl.hpp:1:1:
    +#include <mutex>
     #pragma once
    include/mbgl/util/work_task_impl.hpp:46:5:
         std::recursive_mutex mutex;
         ^~~
    include/mbgl/util/work_task_impl.hpp: In member function 'void mbgl::WorkTaskImpl<F, P>::operator()()':
    include/mbgl/util/work_task_impl.hpp:21:30: error: 'recursive_mutex' is not a member of 'std'
             std::lock_guard<std::recursive_mutex> lock(mutex);
                                  ^~~~~~~~~~~~~~~
    include/mbgl/util/work_task_impl.hpp:21:30: note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    include/mbgl/util/work_task_impl.hpp:21:45: error: template argument 1 is invalid
             std::lock_guard<std::recursive_mutex> lock(mutex);
                                                 ^
    include/mbgl/util/work_task_impl.hpp:21:52: error: 'mutex' was not declared in this scope
             std::lock_guard<std::recursive_mutex> lock(mutex);
                                                        ^~~~~
    include/mbgl/util/work_task_impl.hpp: In member function 'void mbgl::WorkTaskImpl<F, P>::cancel()':
    include/mbgl/util/work_task_impl.hpp:36:30: error: 'recursive_mutex' is not a member of 'std'
             std::lock_guard<std::recursive_mutex> lock(mutex);
                                  ^~~~~~~~~~~~~~~
    include/mbgl/util/work_task_impl.hpp:36:30: note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    include/mbgl/util/work_task_impl.hpp:36:45: error: template argument 1 is invalid
             std::lock_guard<std::recursive_mutex> lock(mutex);
                                                 ^
    include/mbgl/util/work_task_impl.hpp:36:52: error: 'mutex' was not declared in this scope
             std::lock_guard<std::recursive_mutex> lock(mutex);
                                                        ^~~~~
    mingw32-make[6]: *** [Makefile.Debug:2132: .obj/debug/async_task.o] Error 1
    mingw32-make[6]: Leaving directory 'C:/MyQt/qt-everywhere-opensource-src-5.9.2/qtlocation/src/3rdparty/mapbox-gl-native'
    mingw32-make[5]: *** [Makefile:40: debug-all] Error 2
    mingw32-make[5]: Leaving directory 'C:/MyQt/qt-everywhere-opensource-src-5.9.2/qtlocation/src/3rdparty/mapbox-gl-native'
    mingw32-make[4]: *** [Makefile:197: sub-------3rdparty-mapbox-gl-native-make_first] Error 2
    mingw32-make[4]: Leaving directory 'C:/MyQt/qt-everywhere-opensource-src-5.9.2/qtlocation/src/plugins/geoservices'
    mingw32-make[3]: *** [Makefile:67: sub-geoservices-make_first] Error 2
    mingw32-make[3]: Leaving directory 'C:/MyQt/qt-everywhere-opensource-src-5.9.2/qtlocation/src/plugins'
    mingw32-make[2]: *** [Makefile:201: sub-plugins-make_first] Error 2
    mingw32-make[2]: Leaving directory 'C:/MyQt/qt-everywhere-opensource-src-5.9.2/qtlocation/src'
    mingw32-make[1]: *** [Makefile:43: sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/MyQt/qt-everywhere-opensource-src-5.9.2/qtlocation'
    mingw32-make: *** [Makefile:726: module-qtlocation-make_first] Error 2
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 8 Oct 2018, 13:00 last edited by
      #2

      Hi
      What version of mingw ?
      I think mingw do not have support for std::recursive_mutex
      or at least not in the version that comes with 5.9.2
      Or at least thats what i found on google.
      But most post are few years old.

      O 1 Reply Last reply 8 Oct 2018, 13:39
      3
      • M mrjj
        8 Oct 2018, 13:00

        Hi
        What version of mingw ?
        I think mingw do not have support for std::recursive_mutex
        or at least not in the version that comes with 5.9.2
        Or at least thats what i found on google.
        But most post are few years old.

        O Offline
        O Offline
        ODБOï
        wrote on 8 Oct 2018, 13:39 last edited by
        #3

        Hi,
        Thx for answer
        @mrjj said in Compiling Qt from sources:

        What version of mingw ?

        This is not a version that comes with Qt but a separate installation of minGw, is this bad ?

        mingw32-make - v
        output :
        GNU Make 4.2.1
        Built for x86_64-w64-mingw32

        I will try to :
        use more recent verions
        use minGw witch comes with qt tools

        Thank you

        M 1 Reply Last reply 8 Oct 2018, 14:09
        0
        • O ODБOï
          8 Oct 2018, 13:39

          Hi,
          Thx for answer
          @mrjj said in Compiling Qt from sources:

          What version of mingw ?

          This is not a version that comes with Qt but a separate installation of minGw, is this bad ?

          mingw32-make - v
          output :
          GNU Make 4.2.1
          Built for x86_64-w64-mingw32

          I will try to :
          use more recent verions
          use minGw witch comes with qt tools

          Thank you

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 8 Oct 2018, 14:09 last edited by
          #4

          @LeLev
          Hi
          Its not bad pr se, but i did burn my fingers using other version
          that the one Qt provides. One issue can be 64 bit but it seems you are using 32.
          so i would try the included mingw.
          I know the test is not trivial due to huge compile times:)

          O 1 Reply Last reply 8 Oct 2018, 14:22
          3
          • M mrjj
            8 Oct 2018, 14:09

            @LeLev
            Hi
            Its not bad pr se, but i did burn my fingers using other version
            that the one Qt provides. One issue can be 64 bit but it seems you are using 32.
            so i would try the included mingw.
            I know the test is not trivial due to huge compile times:)

            O Offline
            O Offline
            ODБOï
            wrote on 8 Oct 2018, 14:22 last edited by
            #5

            @mrjj Thaks, i will try this tomorrow

            O 1 Reply Last reply 9 Oct 2018, 14:10
            0
            • O ODБOï
              8 Oct 2018, 14:22

              @mrjj Thaks, i will try this tomorrow

              O Offline
              O Offline
              ODБOï
              wrote on 9 Oct 2018, 14:10 last edited by ODБOï 10 Sept 2018, 14:10
              #6

              hi @mrjj

              6 houres ans 20 minutes and it is still running, is this normal ?

              Intel Core i5-6500 / 3.20 GHz
              8 Go RAM

              M 1 Reply Last reply 9 Oct 2018, 14:26
              0
              • O ODБOï
                9 Oct 2018, 14:10

                hi @mrjj

                6 houres ans 20 minutes and it is still running, is this normal ?

                Intel Core i5-6500 / 3.20 GHz
                8 Go RAM

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 9 Oct 2018, 14:26 last edited by
                #7

                @LeLev
                thats a bit long. does it uses all cores ?
                i mean did u use the -j option ?

                O 1 Reply Last reply 9 Oct 2018, 15:05
                4
                • M mrjj
                  9 Oct 2018, 14:26

                  @LeLev
                  thats a bit long. does it uses all cores ?
                  i mean did u use the -j option ?

                  O Offline
                  O Offline
                  ODБOï
                  wrote on 9 Oct 2018, 15:05 last edited by
                  #8

                  @mrjj No.. Sadly i have not used -j , next time, for sure i will use it, Thank you

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    ODБOï
                    wrote on 10 Oct 2018, 10:43 last edited by ODБOï 10 Oct 2018, 10:49
                    #9

                    Hi @mrjj, finally done!

                    But just a empty qtquick App 600Mo ?

                    I knew static makes the executable bigger but i was not expecting 600mo. There must be some techniques to optimise the executable size, no ?

                    edit : actually that was a debug build, release version is 20Mo

                    @mrjj meny thx for help

                    M 1 Reply Last reply 10 Oct 2018, 11:28
                    1
                    • O ODБOï
                      10 Oct 2018, 10:43

                      Hi @mrjj, finally done!

                      But just a empty qtquick App 600Mo ?

                      I knew static makes the executable bigger but i was not expecting 600mo. There must be some techniques to optimise the executable size, no ?

                      edit : actually that was a debug build, release version is 20Mo

                      @mrjj meny thx for help

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 10 Oct 2018, 11:28 last edited by
                      #10

                      @LeLev
                      Good work :)
                      and yes, debug builds are amazingly fat.

                      O 1 Reply Last reply 10 Oct 2018, 15:04
                      2
                      • M mrjj
                        10 Oct 2018, 11:28

                        @LeLev
                        Good work :)
                        and yes, debug builds are amazingly fat.

                        O Offline
                        O Offline
                        ODБOï
                        wrote on 10 Oct 2018, 15:04 last edited by
                        #11

                        @mrjj Hi,

                        I have a last question pls :

                        The folder where i installed Qt static version has now size of 638 Go ! is this 'normal' ?

                        M 1 Reply Last reply 10 Oct 2018, 16:09
                        0
                        • O ODБOï
                          10 Oct 2018, 15:04

                          @mrjj Hi,

                          I have a last question pls :

                          The folder where i installed Qt static version has now size of 638 Go ! is this 'normal' ?

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 10 Oct 2018, 16:09 last edited by mrjj 10 Oct 2018, 16:10
                          #12

                          @LeLev
                          I would check where you had build folder. it most like is in that folder too.
                          Seems a bit big :)
                          So there might be tons of .o files etc remaining.

                          1 Reply Last reply
                          3
                          • O Offline
                            O Offline
                            ODБOï
                            wrote on 11 Oct 2018, 09:54 last edited by
                            #13

                            Hi
                            i have saved 300Go by deleting \mingw53_32_static\examples

                            1 Reply Last reply
                            1
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 11 Oct 2018, 10:02 last edited by
                              #14

                              Hi,

                              Always build with -nomake tests -nomake examples especially when doing a static build.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              3

                              1/14

                              8 Oct 2018, 07:34

                              • Login

                              • Login or register to search.
                              1 out of 14
                              • First post
                                1/14
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved