Build Qt5.15 on ubuntu 22.04 with GCC 11
Unsolved
General and Desktop
-
The GCC11 compiler complains about ‘‘numeric_limits’ is not a class template’ when I was building Qt5.15 from source on Ubuntu 22.04.
~/qt5-static-build/build$ ~/Qt/5.15.2/Src/configure -static -release -prefix /home/zq/qt5-static-build/install -skip webengine -nomake tests -nomake examples + cd qtbase + /home/zq/Qt/5.15.2/Src/qtbase/configure -top-level -static -release -prefix /home/zq/qt5-static-build/install -skip webengine -nomake tests -nomake examples Preparing build tree... Creating qmake... ............................In file included from /home/zq/Qt/5.15.2/Src/qtbase/include/QtCore/qfloat16.h:1, from /home/zq/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qendian.h:44, from /home/zq/Qt/5.15.2/Src/qtbase/include/QtCore/qendian.h:1, from /home/zq/Qt/5.15.2/Src/qtbase/src/corelib/codecs/qutfcodec.cpp:43: /home/zq/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qfloat16.h:300:7: error: ‘numeric_limits’ is not a class template 300 | class numeric_limits<QT_PREPEND_NAMESPACE(qfloat16)> : public numeric_limits<float> ...
Any advice? Should I downgrade my GCC 11 or is there a patch from Qt for this? Thanks.
-
you can upgrade ubuntu 22.04 and the latest has gcc 12 now. Higher version of gcc has more modern C++ support. No need to build 5.15.2 on Ubuntu 22.04. Simply install Qt and its version is 5.15.3. I do not think there are big differences between15.2 and 15.3.
-
The forum search would be a good start to find the solution: https://forum.qt.io/topic/139626