[Qgis-developer] Problems building for QT5
Alessandro Pasotti
apasotti at gmail.com
Wed May 6 07:19:20 PDT 2015
2015-05-06 15:57 GMT+02:00 Jürgen E. <jef at norbit.de>:
> Hi Alessandro,
>
> On Wed, 06. May 2015 at 10:54:19 +0200, Alessandro Pasotti wrote:
> > This runs fine from the build directory:
> > LD_LIBRARY_PATH=output/lib/ output/bin/qgis
> >
> > It seems like the install process (make install) removes the runtime path
> > from the .so and this causes the problem: running ldd in output/lib/
> > doesn't show any Qt 4 lib while running ldd on the installed
> libqgis_gui.so
> > shows libQtCore.so.4 libQtGui.so.4 etc.
>
> hm, why would a libqgis_gui.so suddenly start to point at libQtCore.so
> when the
> Qt5 version it's linked against is named libQt5Core.so? Are you sure the
> libqgis_gui.so is the shared library you installed and not a previous ony
> built
> with Qt4?
>
Yes 100% sure, this was driving me mad, the library built in build tree
output directory is the same exact size and time as the installed one but
has different md5, this led me to inspect what "make install" does, and to
discover that it strips RPATH by default.
So, the library in output find the right libraries (Qt5) while the same
RPATH-stripped library in the install directory doesn't, or to be precise,
it finds Qt5 but also loads Qt4 (don't ask me why...).
Look at this (notice the Qt(4) libs in the installed version, missing from
the built output):
ll output/lib/libqgis_gui.so.2.9.0
-rwxrwxr-x 1 ale ale 98778227 mag 6 10:39 output/lib/libqgis_gui.so.2.9.0*
md5sum output/lib/libqgis_gui.so.2.9.0
5a1070065a2bab8d3d55e973d680a449 output/lib/libqgis_gui.so.2.9.0
~/dev/QGIS/build-local-qt5: ll ../../../apps-qt5/lib/libqgis_gui.so.2.9.0
-rw-r--r-- 1 ale ale 98778227 mag 6 10:39
../../../apps-qt5/lib/libqgis_gui.so.2.9.0
md5sum ../../../apps-qt5/lib/libqgis_gui.so.2.9.0
881453e5b5d087e8d1029af49d1f4026 ../../../apps-qt5/lib/libqgis_gui.so.2.9.0
~/dev/QGIS/build-local-qt5: ldd output/lib/libqgis_gui.so.2.9.0|grep Qt |
grep -v Qt5
libQt5Xml.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5
(0x00007fb7925c1000)
libQt5Svg.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5
(0x00007fb792374000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
(0x00007fb78ecab000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
(0x00007fb78e34b000)
... some more Qt5 and NO Qt (4) ...
~/dev/QGIS/build-local-qt5: ldd
../../../apps-qt5/lib/libqgis_gui.so.2.9.0|grep Qt
libQt5Xml.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5
(0x00007f7779050000)
libQt5Svg.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5
(0x00007f7778e04000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
(0x00007f777573a000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
(0x00007f7774dda000)
libQtSvg.so.4 => /usr/lib/x86_64-linux-gnu/libQtSvg.so.4
(0x00007f7773f9d000)
libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4
(0x00007f77732e9000)
libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4
(0x00007f7772e04000)
... ^^^^^^^^^^^^
... some more Qt5 ....
Running the installed one with LD_LIBRARY_PATH pointing to the installed
libs segfaults immediately.
Running the build tree one with LD_LIBRARY_PATH pointing to the build tree
output works.
Still investigating...
--
Alessandro Pasotti
w3: www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150506/47896a5b/attachment-0001.html>
More information about the Qgis-developer
mailing list