Error installing qt-everywhere-src-5.15.2 on ubuntu 22.04
-
Hello,
I tried installing qt on a fresh install of ubuntu 22.04 but it throws this error
"
/Downloads$ cd qt-everywhere-src-5.15.2/
~/Downloads/qt-everywhere-src-5.15.2$ ./configure- cd qtbase
- /Downloads/qt-everywhere-src-5.15.2/qtbase/configure -top-level
Creating qmake...
.In file included from /Downloads/qt-everywhere-src-5.15.2/qtbase/include/QtCore/qfloat16.h:1,
from /Downloads/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/global/qendian.h:44,
from /Downloads/qt-everywhere-src-5.15.2/qtbase/include/QtCore/qendian.h:1,
from /Downloads/qt-everywhere-src-5.15.2/qtbase/src/corelib/codecs/qutfcodec.cpp:43:
/Downloads/qt-everywhere-src-5.15.2/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>
| ^~~~~~~~~~~~~~
/Downloads/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/global/qfloat16.h:300:77: error: expected template-name before ‘<’ token
300 | c_limits<QT_PREPEND_NAMESPACE(qfloat16)> : public numeric_limits<float>
| ^
/Downloads/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/global/qfloat16.h:300:77: error: expected ‘{’ before ‘<’ token
/Downloads/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/global/qfloat16.h:344:18: error: ‘numeric_limits’ is not a class template
344 | template<> class numeric_limits<const QT_PREPEND_NAMESPACE(qfloat16)>
| ^~~~~~~~~~~~~~gmake: *** [Makefile:383: qutfcodec.o] Error 1
"
Am I missing something?
Thanks for response -
Hi, it looks like you've been bitten by this bug
Edit: that bug listed another bugno. which has a suggested workaround:
...
For me the wollowing solution works to build both Qt5 ant Qt6 with GCC 11: I add these 3 lines at the top of qtbase/src/corelib/global/qglobal.h :
#ifdef __cplusplus
#include <limits>
#endif
... -
@hskoglund That did it for me, Thanks a lot.