Can't find libQt5Core lib
-
Hello! I have a little trouble with app deployment.
I have installed Qt5 to /usr/local/qt5 (and it is not added to ldconfig).
qt5/lib:cmake libQt5MultimediaGstTools.so libQt5AccessibilitySupport.a libQt5MultimediaGstTools.so.5 libQt5AccessibilitySupport.la libQt5MultimediaGstTools.so.5.12 libQt5AccessibilitySupport.prl libQt5MultimediaGstTools.so.5.12.0 libQt5Bootstrap.a libQt5MultimediaWidgets.la libQt5Bootstrap.la libQt5MultimediaWidgets.prl libQt5Bootstrap.prl libQt5MultimediaWidgets.so libQt5Concurrent.la libQt5MultimediaWidgets.so.5 libQt5Concurrent.prl libQt5MultimediaWidgets.so.5.12 libQt5Concurrent.so libQt5MultimediaWidgets.so.5.12.0 libQt5Concurrent.so.5 libQt5Network.la libQt5Concurrent.so.5.12 libQt5Network.prl libQt5Concurrent.so.5.12.0 libQt5Network.so libQt5Core.la libQt5Network.so.5 libQt5Core.prl libQt5Network.so.5.12 libQt5Core.so libQt5Network.so.5.12.0 libQt5Core.so.5 libQt5PrintSupport.la libQt5Core.so.5.12 libQt5PrintSupport.prl libQt5Core.so.5.12.0 libQt5PrintSupport.so libQt5DeviceDiscoverySupport.a libQt5PrintSupport.so.5 libQt5DeviceDiscoverySupport.la libQt5PrintSupport.so.5.12 libQt5DeviceDiscoverySupport.prl libQt5PrintSupport.so.5.12.0 libQt5EdidSupport.a libQt5SerialPort.la libQt5EdidSupport.la libQt5SerialPort.prl libQt5EdidSupport.prl libQt5SerialPort.so libQt5EventDispatcherSupport.a libQt5SerialPort.so.5 libQt5EventDispatcherSupport.la libQt5SerialPort.so.5.12 libQt5EventDispatcherSupport.prl libQt5SerialPort.so.5.12.0 libQt5FbSupport.a libQt5ServiceSupport.a libQt5FbSupport.la libQt5ServiceSupport.la libQt5FbSupport.prl libQt5ServiceSupport.prl libQt5FontDatabaseSupport.a libQt5Sql.la libQt5FontDatabaseSupport.la libQt5Sql.prl libQt5FontDatabaseSupport.prl libQt5Sql.so libQt5Gui.la libQt5Sql.so.5 libQt5Gui.prl libQt5Sql.so.5.12 libQt5Gui.so libQt5Sql.so.5.12.0 libQt5Gui.so.5 libQt5ThemeSupport.a libQt5Gui.so.5.12 libQt5ThemeSupport.la libQt5Gui.so.5.12.0 libQt5ThemeSupport.prl libQt5InputSupport.a libQt5Widgets.la libQt5InputSupport.la libQt5Widgets.prl libQt5InputSupport.prl libQt5Widgets.so libQt5Multimedia.la libQt5Widgets.so.5 libQt5Multimedia.prl libQt5Widgets.so.5.12 libQt5Multimedia.so libQt5Widgets.so.5.12.0 libQt5Multimedia.so.5 libqtfreetype.a libQt5Multimedia.so.5.12 libqtfreetype.prl libQt5Multimedia.so.5.12.0 libqtlibpng.a libQt5MultimediaGstTools.la libqtlibpng.prl libQt5MultimediaGstTools.prl pkgconfig
I'm trying run my own app via script run.sh:
#!/bin/bash LD_LIBRARY_PATH=/usr/local/qt5/lib ./build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp
but I've got exception:
build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp) build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /usr/local/qt5/lib/libQt5Widgets.so.5) build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by /usr/local/qt5/lib/libQt5Widgets.so.5) build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /usr/local/qt5/lib/libQt5Gui.so.5) build-TestQtWApp-ARM_imx_6-Debug/TestQtWApp: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by /usr/local/qt5/lib/libQt5Gui.so.5)
What I'm doing wrong? Any ideas?
Thanks! -
@koahnig this in on embedded device.
Qt libs and Qt App was cross-compiled with arm-linux-gnueabihf
I removed all qt files from /usr/lib/arm-linux-gnueabihf/ on embedded device and now I've got:error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory
I tried to place Qt libraries to the current work directory, I tried to create launcher (like described here http://doc.qt.io/archives/qt-4.8/deployment-x11.html). All without success, libQt5Core can't be found
Also on I published on the github my script which do a cross-compilation of qtbase.
-
Hi,
Unless you modified the rpath of your application, putting your application dependencies in the same folder won't have any effect. You can use the
LD_LIBRARY_PATH
environment variable to give additional paths to the loader to search in when starting your application. -
@SGaist thanks for answer. Yes, I did set LD_LIBRARY_PATH to needed value.
So, I recompiled my application, did copy of needed libs to embedded device and setted LD_LIBRARY_PATH.
Now I have another exception:/ta512/./ta: error while loading shared libraries: /home/imx6/Desktop/qt5120/sysroot/usr/lib/libz.so: cannot open shared object file: No such file or directory
This is path on my host-machine, but not in the current embedded device.
The path to libz in my embedded device is /ta512/lib/libz.so and it already defined in LD_LIBRARY_PATH.
Why application remembered a full path to libz from my host-machine and doesn't looks in LD_LIBRARY_PATH?
(directly my application doen't uses libz, which requires by glib, which requires by Qt) -
You should run ldd (with LD_LIBRARY_PATH defined) on your application and its dependencies to see where it's currently looking for them.
-
# export LD_LIBRARY_PATH=/ta512/glib:/ta512/qt5lib # /ta512/ta /ta512/ta: error while loading shared libraries: /home/imx6/Desktop/qt5120/sysroot/usr/lib/libz.so: cannot open shared object file: No such file or directory # ldd /ta512/ta /ta512/ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by /ta512/ta) /ta512/ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /ta512/qt5lib/libQt5Widgets.so.5) /ta512/ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by /ta512/qt5lib/libQt5Widgets.so.5) /ta512/ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /ta512/qt5lib/libQt5Gui.so.5) /ta512/ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by /ta512/qt5lib/libQt5Gui.so.5) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libicui18n.so.55) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libicui18n.so.55) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libicui18n.so.55) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libicuuc.so.55) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libicuuc.so.55) /ta512/ta: /ta512/glib/libstdc++.so.6: no version information available (required by /usr/lib/arm-linux-gnueabihf/libicuuc.so.55) /ta512/ta: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /ta512/glib/libglib-2.0.so.0) linux-vdso.so.1 => (0x7ee3e000) libQt5Widgets.so.5 => /ta512/qt5lib/libQt5Widgets.so.5 (0x76a51000) libQt5Gui.so.5 => /ta512/qt5lib/libQt5Gui.so.5 (0x765b0000) libQt5Core.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 (0x7624b000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76227000) libstdc++.so.6 => /ta512/glib/libstdc++.so.6 (0x760be000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76045000) libgcc_s.so.1 => /ta512/glib/libgcc_s.so.1 (0x76016000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x75f2a000) /home/imx6/Desktop/qt5120/sysroot/usr/lib/libz.so => not found libz.so.1 => /ta512/glib/libz.so.1 (0x75efa000) libicui18n.so.55 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.55 (0x75d60000) libicuuc.so.55 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.55 (0x75c42000) libpcre16.so.3 => /usr/lib/arm-linux-gnueabihf/libpcre16.so.3 (0x75bec000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x75bd9000) libglib-2.0.so.0 => /ta512/glib/libglib-2.0.so.0 (0x75a43000) librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x75a2c000) /lib/ld-linux-armhf.so.3 (0x54ae3000) libicudata.so.55 => /usr/lib/arm-linux-gnueabihf/libicudata.so.55 (0x74165000)
-
@SGaist ok, I recompiled qtbase without glib, and now I return to the topic theme:
# ls /ta512 Makefile libQt5Widgets.so.5 moc_mainwindow.cpp ta libQt5Core.so.5 main.o moc_mainwindow.o ta.sh libQt5Gui.so.5 mainwindow.o moc_predefs.h ui_mainwindow.h
and run:
# export LD_LIBRARY_PATH=/ta512 # ./ta ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5' not found (required by ./ta) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5_PRIVATE_API' not found (required by /ta512/libQt5Widgets.so.5) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5' not found (required by /ta512/libQt5Widgets.so.5) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5_PRIVATE_API' not found (required by /ta512/libQt5Gui.so.5) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5' not found (required by /ta512/libQt5Gui.so.5) # ldd ta ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5' not found (required by ./ta) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5_PRIVATE_API' not found (required by /ta512/libQt5Widgets.so.5) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5' not found (required by /ta512/libQt5Widgets.so.5) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5_PRIVATE_API' not found (required by /ta512/libQt5Gui.so.5) ./ta: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version 'Qt_5' not found (required by /ta512/libQt5Gui.so.5) linux-vdso.so.1 => (0x7ece4000) libQt5Widgets.so.5 => /ta512/libQt5Widgets.so.5 (0x769e1000) libQt5Gui.so.5 => /ta512/libQt5Gui.so.5 (0x76540000) libQt5Core.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 (0x761db000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x761b7000) libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x760a9000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76031000) libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76008000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x75f1c000) libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x75efa000) libicui18n.so.55 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.55 (0x75d61000) libicuuc.so.55 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.55 (0x75c43000) libpcre16.so.3 => /usr/lib/arm-linux-gnueabihf/libpcre16.so.3 (0x75bec000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x75bd9000) libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x75b01000) librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x75aeb000) /lib/ld-linux-armhf.so.3 (0x54b87000) libicudata.so.55 => /usr/lib/arm-linux-gnueabihf/libicudata.so.55 (0x74224000) libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x741c6000)
-
You are not deploying libQt5Core.so.5 along the other Qt libraries in your ta512 folder.
-
@SGaist ok, I built Qt 5.9.7 with options:
-verbose \ -nomake tests \ -nomake examples \ -no-use-gold-linker \ -no-opengl \ -no-dbus \ -no-glib \ -no-icu \ -rpath
and the target Qt application on the embedded device did found the Qt libs, but I've got another exception:
./qt_c: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /ta/libQt5Core.so.5)
sure, version of glib on the target device is 2.23, but Qt was configured without GLIB support. Why Qt still require this library?
well, as latest results with same cross-compilations process (e.g. same tools, compiler, QtCreator settings, etc):
- cross-compiled app with Qt 5.12.0 can't find self Qt libraries
- cross-compiled app with Qt 5.9.7 can find self Qt libraries, but can't work without GLIB < v2.28 (even configured without glib support)
-
And why are you not deploying the Qt5Core library since you already deploy the others ?
-
@SGaist as I told before I did copy Qt libs with application to the target embedded device (as you can see the folder /ta512 already contains all needed Qt libs and executable application), also I did set value of LD_LIBRARY_PATH to /ta512 before application has been started.
-
That's clear, but from your last test, why only these three libs and not QtCore ?
-
The question is: since you are deploying 3 Qt libraries already, why not the Qt5Core ?
-
Yes it is.
-
@SGaist because the target application is looking for the libQt5Core.so.5, not for libQt5Core.so
howewer I'll try to do copy of all aliases: libQt5Core.so, libQt5Core.so.5 and libQt5Core.so.5.12.0
thanks for hint!
and happy New Year ;) -
If you want to be sure the loader finds the correct library where you put them, then yes, copy all the aliases up to the library itself.