Deploying a Qt application on Ubuntu 18.04
-
wrote on 4 May 2018, 13:37 last edited by bunjee207 5 Apr 2018, 13:39
Greetings Qt Forums,
I'm deploying a Qt application on Ubuntu 18.04.
My binary is built with the following:
unix:QMAKE_LFLAGS += "-Wl,-rpath,'\$$ORIGIN'"
When I run the application I get the following:
error while loading shared libraries: libQt5XmlPatterns.so.5 cannot open object file: No such file or directory.
That's strange because the library is actually there along with the binary.
Also, that shouldn't be related to rpath since libQt5Core.so.5 and a few others are resolved just fine.
Has anybody got the issue before ?
Thanks.
-
Greetings Qt Forums,
I'm deploying a Qt application on Ubuntu 18.04.
My binary is built with the following:
unix:QMAKE_LFLAGS += "-Wl,-rpath,'\$$ORIGIN'"
When I run the application I get the following:
error while loading shared libraries: libQt5XmlPatterns.so.5 cannot open object file: No such file or directory.
That's strange because the library is actually there along with the binary.
Also, that shouldn't be related to rpath since libQt5Core.so.5 and a few others are resolved just fine.
Has anybody got the issue before ?
Thanks.
wrote on 4 May 2018, 13:59 last edited by JonB 5 Apr 2018, 14:05@bunjee207
https://stackoverflow.com/questions/38018966/error-while-loading-shared-libraries-libqt5xmlpatterns-so-5
shows someone long ago with same error message, not resolved, does it give you nay food for thought?EDIT:
Ah, hang on, I believe that you get the "No such file or directory" error on a.so
also whenever any of its dependencies are not found, but it reports the original filename, not the dependent one! Do anldd
on it (or your executable) and you get a definitive list of what it wants that is found & not found.Here's mine (Ubuntu 17.04, Qt fetched from
apt-get
not built locally, nothing missing) :) :jon@ubuntu:~$ ldd /usr/lib/x86_64-linux-gnu/libQt5XmlPatterns.so.5 linux-vdso.so.1 => (0x00007fff0da52000) libQt5Network.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007fd99ffdf000) libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007fd99f915000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd99f58d000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd99f284000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd99f06d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd99eca4000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd99ea86000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd99e86a000) libproxy.so.1 => /usr/lib/x86_64-linux-gnu/libproxy.so.1 (0x00007fd99e64a000) libicui18n.so.57 => /usr/lib/x86_64-linux-gnu/libicui18n.so.57 (0x00007fd99e1d0000) libicuuc.so.57 => /usr/lib/x86_64-linux-gnu/libicuuc.so.57 (0x00007fd99de28000) libpcre16.so.3 => /usr/lib/x86_64-linux-gnu/libpcre16.so.3 (0x00007fd99dbbd000) libdouble-conversion.so.1 => /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1 (0x00007fd99d9ac000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd99d7a8000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fd99d494000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd99d28c000) /lib64/ld-linux-x86-64.so.2 (0x000055736a0d6000) libicudata.so.57 => /usr/lib/x86_64-linux-gnu/libicudata.so.57 (0x00007fd99b80d000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fd99b59a000) jon@ubuntu:~$
I bet you or your deployment is missing one of those! :)
-
wrote on 4 May 2018, 16:38 last edited by
Hi, the dependency on libQt5XmlPatterns.so.5 can be from one of your plugins, there's one called libqmlxmllistmodelplugin.so that tries to pull in libQt5XmlPatterns.so.5.
However libqmlxmllistmodelplugin seems to be built with
$ORIGIN/../../../lib
so I think libQt5XmlPatterns.so.5 needs to be in that place relative to where libqmlxmllistmodelplugin.so is deployed. -
Hi,
You might want to consider using linuxdeployqt to help you with that matter.
-
wrote on 7 May 2018, 09:20 last edited by
Thanks for your replies,
My application actually depends on a few libraries of my own (SkCore, SkGui...).
Turns out I have to add the rpath line in the project of each library.After that ldd finds the proper dependencies and my application runs.
PS: That does not seem to be required when building with Qt 4.
-
wrote on 7 May 2018, 14:46 last edited by
@bunjee207 great!, so if your issue is solved please don't forget to mark your post as such. Thanks.
-
Greetings Qt Forums,
I'm deploying a Qt application on Ubuntu 18.04.
My binary is built with the following:
unix:QMAKE_LFLAGS += "-Wl,-rpath,'\$$ORIGIN'"
When I run the application I get the following:
error while loading shared libraries: libQt5XmlPatterns.so.5 cannot open object file: No such file or directory.
That's strange because the library is actually there along with the binary.
Also, that shouldn't be related to rpath since libQt5Core.so.5 and a few others are resolved just fine.
Has anybody got the issue before ?
Thanks.
wrote on 20 May 2018, 20:24 last edited by borkowsk@bunjee207 I have similar message when I start qtcreator :-/
-
@bunjee207 I have similar message when I start qtcreator :-/
wrote on 20 May 2018, 20:44 last edited by@borkowsk
sudo apt install qtcreator
[sudo] password for borkowsk:
Reading package lists... Done
Building dependency tree
Reading state information... Done
qtcreator is already the newest version (4.5.2-3ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
borkowsk@wojciech-CELSIUS-7:~$ qtcreator
qtcreator: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory -
Hi and welcome to devnet,
Did you modify your
PATH
environment variable ? -
wrote on 21 May 2018, 12:57 last edited by borkowsk
@SGaist
I dont think so :-) Should I do it manually?
This is my path and result of calling "konsole" (similar for krusader etc...)borkowsk@wojciech-CELSIUS-7:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
borkowsk@wojciech-CELSIUS-7:~$ konsole
konsole: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directoryAll this library exist but are not visible...
borkowsk@wojciech-CELSIUS-7:~$ ls /usr/lib/x86_64-linux-gnu/libQt5*
/usr/lib/x86_64-linux-gnu/libQt5Concurrent.prl /usr/lib/x86_64-linux-gnu/libQt5QuickTest.so.5
/usr/lib/x86_64-linux-gnu/libQt5Concurrent.so /usr/lib/x86_64-linux-gnu/libQt5QuickTest.so.5.9
/usr/lib/x86_64-linux-gnu/libQt5Concurrent.so.5 /usr/lib/x86_64-linux-gnu/libQt5QuickTest.so.5.9.5
...
/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl
...
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so
...
/usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.9 /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5.9
/usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.9.5 /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5.9.5 -
wrote on 21 May 2018, 16:10 last edited by
borkowsk@wojciech-CELSIUS-7:~$ file /usr/lib/x86_64-linux-gnu/libQt5Widgets.so
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so: broken symbolic link to libQt5Widgets.so.5.9.5Looks like something is missing during installation. How to fix this?
-
wrote on 21 May 2018, 16:21 last edited by
@borkowsk
This is probably due the grub crashing during installation od 18.04:sudo apt-get install libQt*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libqtscript4-opengl' for glob 'libQt*'
Note, selecting 'libqtcore4-perl' for glob 'libQt*'
...
libqt5xmlpatterns5 is already the newest version (5.9.5-0ubuntu1).
libqt5xmlpatterns5 set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libqtdee3 : Conflicts: libqtdee2 but 0.2.4-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.