Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Unable to build static version of Qt 5.15.2
Qt 6.11 is out! See what's new in the release blog

Unable to build static version of Qt 5.15.2

Scheduled Pinned Locked Moved Solved Installation and Deployment
21 Posts 10 Posters 17.0k Views 1 Watching
  • 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.
  • Christian EhrlicherC Online
    Christian EhrlicherC Online
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #11

    Manually adding two include statements in two files shouldn't be that hard

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    R 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      Manually adding two include statements in two files shouldn't be that hard

      R Offline
      R Offline
      robertwilliamallen
      wrote on last edited by
      #12

      @Christian-Ehrlicher Yep. I figured as much after I asked. So that is done and it seemed to get further in the compilation but I'm still getting errors:

      Creating qmake...
      ........................................In file included from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearray.cpp:43:
      /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h: In static member function ‘static QStaticByteArrayMatcherBase::Skiptable QStaticByteArrayMatcherBase::generate(const char*, uint)’:
      /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h:103:38: error: ‘numeric_limits’ is not a member of ‘std’
        103 |         const auto uchar_max = (std::numeric_limits<uchar>::max)();
            |                                      ^~~~~~~~~~~~~~
      /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h:103:58: error: expected primary-expression before ‘>’ token
        103 |         const auto uchar_max = (std::numeric_limits<uchar>::max)();
            |                                                          ^
      /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h:103:61: error: ‘::max’ has not been declared; did you mean ‘std::max’?
        103 |         const auto uchar_max = (std::numeric_limits<uchar>::max)();
            |                                                             ^~~
            |                                                             std::max
      In file included from /usr/include/c++/11/algorithm:62,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:142,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/include/QtCore/qglobal.h:1,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/thread/qatomic.h:41,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/include/QtCore/qatomic.h:1,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/tools/qrefcount.h:43,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/include/QtCore/qrefcount.h:1,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearray.h:44,
                       from /home/robert/Documents/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearray.cpp:42:
      /usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
       3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
            |     ^~~
      gmake: *** [Makefile:350: qbytearray.o] Error 1
      
      
      1 Reply Last reply
      0
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #13

        As you can see the compiler complains again about numeric_limits so add this include there too.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        R O 2 Replies Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          As you can see the compiler complains again about numeric_limits so add this include there too.

          R Offline
          R Offline
          robertwilliamallen
          wrote on last edited by
          #14

          @Christian-Ehrlicher Added #include <limits> to qbytearraymatcher.h and it worked. Thanks for your help! Just getting into Qt and definitely feeling the learning curve.

          P Y 2 Replies Last reply
          2
          • R robertwilliamallen

            @Christian-Ehrlicher Added #include <limits> to qbytearraymatcher.h and it worked. Thanks for your help! Just getting into Qt and definitely feeling the learning curve.

            P Offline
            P Offline
            papaya
            wrote on last edited by
            #15

            @robertwilliamallen It works,good job!!!

            1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher referenced this topic on
            • R robertwilliamallen

              @Christian-Ehrlicher Added #include <limits> to qbytearraymatcher.h and it worked. Thanks for your help! Just getting into Qt and definitely feeling the learning curve.

              Y Offline
              Y Offline
              yudingyuan
              wrote on last edited by
              #16

              @robertwilliamallen thanks

              1 Reply Last reply
              0
              • B Offline
                B Offline
                brant_luo
                wrote on last edited by
                #17

                @papaya said in Unable to build static version of Qt 5.15.2:

                It works,good job!!!

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  CyberCrisis
                  wrote on last edited by
                  #18

                  I am using Qt5.12.6 and I was getting the same error. While attempting this solution I noticed that qglobal.h is included in all these files mentioned, so I added limits include to the __cplusplus check like this and it worked:

                  #ifdef __cplusplus
                  #  include <type_traits>
                  #  include <limits>
                  #  include <cstddef>
                  #  include <utility>
                  #endif
                  
                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    As you can see the compiler complains again about numeric_limits so add this include there too.

                    O Offline
                    O Offline
                    otaolafr
                    wrote on last edited by
                    #19

                    @Christian-Ehrlicher Hello,
                    is there anywhere we can ask for the files to be updated? the ones in the https://download.qt.io/official_releases/qt/5.15/5.15.2/single/
                    still have this issue I struggled to compile it until I found this post by chance.... would be great to rectify this for other future people out there....

                    SGaistS 1 Reply Last reply
                    0
                    • O otaolafr

                      @Christian-Ehrlicher Hello,
                      is there anywhere we can ask for the files to be updated? the ones in the https://download.qt.io/official_releases/qt/5.15/5.15.2/single/
                      still have this issue I struggled to compile it until I found this post by chance.... would be great to rectify this for other future people out there....

                      SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #20

                      @otaolafr Hi,

                      If you are building from source anyway, you should download a more recent version such as 5.15.11. See the content of the 5.15 releases folder.

                      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
                      0
                      • J Offline
                        J Offline
                        jd95
                        wrote on last edited by
                        #21

                        it generates this error with gcc11.x

                        compile it specifically using gcc9.x (for e.g. gcc9.4) and it will compile without any problem

                        1 Reply Last reply
                        0

                        • Login

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