Unable to build static version of Qt 5.15.2
-
So apply the patch in my links since it's for gcc11 and up.
-
@Christian-Ehrlicher Will try and report back. Thanks!
-
@Christian-Ehrlicher I have never applied a patch and not sure how to do that. Is there a guide somewhere I can follow?
-
Manually adding two include statements in two files shouldn't be that hard
-
@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
-
As you can see the compiler complains again about numeric_limits so add this include there too.
-
@Christian-Ehrlicher Added
#include <limits>
toqbytearraymatcher.h
and it worked. Thanks for your help! Just getting into Qt and definitely feeling the learning curve. -
@robertwilliamallen It works,good job!!!
-
-
@robertwilliamallen thanks
-
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
-
@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.... -
@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.