Failed to build Qt 5.11.0 from source on CentOS 7 but no problem with Qt 5.10.1
I built & installed 32- and 64-bit Qt 5.10.1 from the source on Windows 10 with VS2017 without any problem. I also built & installed 32- and 64-bit Qt 5.10.1 on CentOS 7 without any problem.
Now, I tried to do the same with the Qt 5.11.0 source. There is no problem on Windows for both bitnesses. But on CentOS 7 I am unable to build because of C++ compiler errors. Did someone try to build Qt 5.11.0 on CentOS 7?
I can post the exact errors I get on CentOS 7 on request if need be. Just let me know.
just a shot in the dark: is your compiler recent enough? CentOS tend to ship very stable but also very old packages.
It may be Qt is just needing anything not available from your compiler.
I doubt that because the GCC version 4.8 is a requirement for Linux. The latest CentOS which is CentOS 7 is fully updated and has GCC 4.8.5 installed which satisfies the platform requirement according to the Qt documentation. I did not notice any difference in Linux requirements between Qt 5.10.1 and 5.11.0.
The whole point I use CentOS is because it is very conservative and keeps everything as version-wise low as possible.
Yeah, acording to https://doc.qt.io/qt-5/supported-platforms-and-configurations.html gcc 4.8 is supported. So it must be something else.
What exact error are you getting ?
Let me re-run the 32-bit build...
Just started. Just like in the case of Qt 5.10.1, here is the configuration I specified:
../configure -platform linux-g++-32 -plugin-sql-sqlite -qt-xcb -qt-libpng -qt-libjpeg -shared -prefix /w1/ossi/Qt/Qt5.11.0-x86 -nomake examples -nomake tests
After the above a success, the next command was as follows:
make -j2 2>&1 | tee -a b32.log
Apparently the error occurs in the qtlocation module. I am showing the very first error that occurred. If you need more of the log, I can provide. Here is the first error:
g++ -c -include .pch/Qt5Location -m32 -pipe -mfpmath=sse -O3 -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -D_REENTRANT -fPIC -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_LOCATION_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_POSITIONING_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/w2/nick/qt/qtlocation/src/location -I. -I/w2/nick/qt/qtlocation/src/3rdparty/earcut -I/w2/nick/qt/qtlocation/src/3rdparty/poly2tri -I/w2/nick/qt/qtlocation/src/3rdparty/clipper -I/w2/nick/qt/qtlocation/src/3rdparty/clip2tri -I/w2/nick/qt/qtlocation/src/positioning -I/w2/nick/qt/qtlocation/src/imports/positioning -I/w2/nick/qt/qtlocation/src/location -I/w2/nick/qt/qtlocation/src/location/maps -I/w2/nick/qt/qtlocation/src/location/places -I/w2/nick/qt/qtlocation/src/location/declarativemaps -I/w2/nick/qt/qtlocation/src/location/declarativeplaces -I/w2/nick/qt/qtlocation/src/location/labs -I/w2/nick/qt/qtlocation/include -I/w2/nick/qt/qtlocation/include/QtLocation -I../../include -I../../include/QtLocation -I/w2/nick/qt/qtlocation/include/QtLocation/5.11.0 -I/w2/nick/qt/qtlocation/include/QtLocation/5.11.0/QtLocation -I../../include/QtLocation/5.11.0 -I../../include/QtLocation/5.11.0/QtLocation -I/w2/nick/qt/qtlocation/include/QtPositioning/5.11.0 -I/w2/nick/qt/qtlocation/include/QtPositioning/5.11.0/QtPositioning -I../../include/QtPositioning/5.11.0 -I../../include/QtPositioning/5.11.0/QtPositioning -I/w2/nick/qt/qtdeclarative/include/QtQuick/5.11.0 -I/w2/nick/qt/qtdeclarative/include/QtQuick/5.11.0/QtQuick -I/w2/nick/qt/b32/qtdeclarative/include/QtQuick/5.11.0 -I/w2/nick/qt/b32/qtdeclarative/include/QtQuick/5.11.0/QtQuick -I/w2/nick/qt/qtbase/include/QtGui/5.11.0 -I/w2/nick/qt/qtbase/include/QtGui/5.11.0/QtGui -I/w2/nick/qt/b32/qtbase/include/QtGui/5.11.0 -I/w2/nick/qt/b32/qtbase/include/QtGui/5.11.0/QtGui -I/w2/nick/qt/qtdeclarative/include/QtQml/5.11.0 -I/w2/nick/qt/qtdeclarative/include/QtQml/5.11.0/QtQml -I/w2/nick/qt/b32/qtdeclarative/include/QtQml/5.11.0 -I/w2/nick/qt/b32/qtdeclarative/include/QtQml/5.11.0/QtQml -I/w2/nick/qt/qtbase/include/QtCore/5.11.0 -I/w2/nick/qt/qtbase/include/QtCore/5.11.0/QtCore -I/w2/nick/qt/b32/qtbase/include/QtCore/5.11.0 -I/w2/nick/qt/b32/qtbase/include/QtCore/5.11.0/QtCore -I/w2/nick/qt/qtlocation/include/QtPositioning -I../../include/QtPositioning -I/w2/nick/qt/qtdeclarative/include -I/w2/nick/qt/qtdeclarative/include/QtQuick -I/w2/nick/qt/b32/qtdeclarative/include -I/w2/nick/qt/b32/qtdeclarative/include/QtQuick -I/w2/nick/qt/qtbase/include -I/w2/nick/qt/qtbase/include/QtGui -I/w2/nick/qt/b32/qtbase/include -I/w2/nick/qt/b32/qtbase/include/QtGui -I/w2/nick/qt/qtdeclarative/include/QtQml -I/w2/nick/qt/b32/qtdeclarative/include/QtQml -I/w2/nick/qt/qtbase/include/QtNetwork -I/w2/nick/qt/b32/qtbase/include/QtNetwork -I/w2/nick/qt/qtbase/include/QtCore -I/w2/nick/qt/b32/qtbase/include/QtCore -I.moc -isystem /usr/include/libdrm -I/w2/nick/qt/qtbase/mkspecs/linux-g++-32 -o .obj/qdeclarativegeomap.o /w2/nick/qt/qtlocation/src/location/declarativemaps/qdeclarativegeomap.cpp
In file included from /w2/nick/qt/qtlocation/include/QtLocation/5.11.0/QtLocation/private/qgeomap_p.h:1:0,
/w2/nick/qt/qtlocation/include/QtLocation/5.11.0/QtLocation/private/../../../../../src/location/maps/qgeomap_p.h:174:18: warning: ‘QGeoMapPrivate’ is already a friend of ‘QGeoMap’ [enabled by default]
friend class QGeoMapPrivate;
/w2/nick/qt/qtlocation/src/location/declarativemaps/qdeclarativegeomap.cpp: In member function ‘void QDeclarativeGeoMap::mappingManagerInitialized()’:
/w2/nick/qt/qtlocation/src/location/declarativemaps/qdeclarativegeomap.cpp:699:91: error: no matching function for call to ‘QDeclarativeGeoMap::connect(QPointer<QGeoMap>&, void (QGeoMap::*)(const QString&), QDeclarativeGeoMap::mappingManagerInitialized()::__lambda9)’
Where did you get the sources from ?
As in the case of 5.10.1, I got the source for Linux here:
For Windows I used the zip file and for Linux I used the .tar.xz file.
I can't help you but have exactly the same issue with SuSE 42.3.
What version of GCC are you using ?
Above I indicated that CentOS 7 comes with GCC 4.8.5. Here is a more detailed information:
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Using built-in specs.
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
UPDATE: Just tried the newly released Qt 5.11.1 and got exactly the same problem as above, unfortunately. Will stick with version 5.10.1 which had no problems building on Windows both x86 & x64, Linux x86 & x64 as well as on Mac x64.
@Foghorn On this page http://doc.qt.io/qt-5/supported-platforms.html is stated that on RHEL7 (CentOS7) you need GCC 5.3.1, even on RHEL6 you need GCC 4.9.1. So, looks like your configuration is not supported by latest Qt release.
So you are saying that it is NOT possible to build on the latest CentOS? That seems strange, doesn't it?
Why do you assume that CentOS 7 is the same as RED HAT Enterprise 7.2. The page you refer to was not changed since 5.10x and , as I state above, there is NO problem building 5.10.1. How do you explain that? Where is documentation that would tell you that 5.11x changed so drastically compared to 5.10x that it no longer can be built with GCC 4.8?
@Foghorn I simply pointed you to the page which explains what are the requirements for building Qt on Linux. I did not said it is not possible to build Qt, but you should probably use a newer compiler.
According to this: https://lists.centos.org/pipermail/centos-announce/2017-September/022532.html, CentOS7 is based on RHEL7.4
You asked for an explanation: well, I don't develop Qt itself (you should ask this question on the Qt developers mailing list), but I assume that Qt 5.11 has other compiler requirements than Qt 5.10.
"Where is documentation that would tell you that 5.11x changed so drastically compared to 5.10x that it no longer can be built with GCC 4.8" - take a look at the link I posted. If information posted there is wrong you can ask for a correction.
And please calm down a bit, I spend my own time to answer questions here...
UPDATE: For those who might be interested in how the 5.11.1 build runs on Centos 7 here is my experience so far. Yes, 'devtoolsedt-4' is needed to be installed and enabled. But unfortunately 'devtoolset-4 is a 64-bit toolset. As a result, I managed to build the 64-bit QT SDK 5.11.1 fine, but failed to build the 32-bit QT SDK due to missing libstdc++_nonshared.a. I spent a lot of time trying to find the i686 version of devtoolset-4 and libstdc++_nonshared.a on the internet. I found it here:
I installed the package devtoolset-4-libstdc++-devel-5.3.1-6.1.el6.i686.rpm and managed to build qmake and started the build but ended up in the middle of the 32-bit build with the following error:
/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld.gold: internal error in override_version, at resolve.cc:61
collect2: error: ld returned 1 exit status
make: *** [../../lib/libQt5Qml.so.5.11.1] Error 1
make: Leaving directory
/w2/nick/qt/b32/qtdeclarative/src/qml' make: *** [sub-qml-make_first-ordered] Error 2 make: Leaving directory/w2/nick/qt/b32/qtdeclarative/src'
make: *** [sub-src-make_first] Error 2
make: Leaving directory `/w2/nick/qt/b32/qtdeclarative'
make: *** [module-qtdeclarative-make_first] Error 2
At this point I am about to run out of options. Will be abandoning 5.11.1 and sticking with 5.10.1 which has no problem on Windows, Mac and CentOS 7 whatsoever and does NOT require GCC 5.3.1.
I've reported the same in https://bugreports.qt.io/browse/QTBUG-69512 and it contains a patch. It's a compiler bug fixed in GCC 5 apparently.