0

I'm trying to deploy a Qt application on different OS.

Windows worked like a charm following this help page. Unfortunately, I have problems deploying my software on Linux. I have read this help page, but it seems like I'm not understanding the Plugins section.

What have I done so far:

  • I have compiled my application using QMake
  • I have added all dynamically linked libraries (like: libQt5Core.so.5, libQt5Core.so.5.11.2, libQt5Gui.so.5, libQt5Gui.so.5.11.2...) to the same directory as my application is (some of them are symlinks for some reason but this is not the issue here)
  • I have created a subdirectory called platforms and put the libqxcb.so library there
  • I have created a bash script like suggested in the tutorial which I'm running

EDIT: the following error is already solved:

now I struggle how and which plugins I have to put into my directory as well. I get the following error message:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. 
Available platform plugins are: xcb.
Aborted

According to this question I did run ldd libqxcb.so which lists the following libraries (and many more)

./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.11' not found (required by ./libqxcb.so)
linux-vdso.so.1 (0x00007ffd766c5000)
libQt5XcbQpa.so.5 => /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007fd2a6181000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fd2a5f7f000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fd2a5c69000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fd2a5a24000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fd2a5770000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007fd2a5007000)
libQt5DBus.so.5 => /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5 (0x00007fd2a4d7d000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007fd2a4632000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fd2a43a6000)
...

I have seen that the library libQt5DBus.so.5 is also required. Therefore, I have copied the file (as well as libQt5DBus.so.5.11.2) into the parent directory of platforms where all my other Qt libraries are.

However, I still get the same error message.

Could it be that it has something to do with the first output of ldd since is says "not found"?

    ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.11' not found (required by ./libqxcb.so)?

When I look at my Windows deployment I have additional folders called iconengines, imageformats, styles, translations do I need to provide these folders and libraries as well? If yes where do I find them and how can I check which one I need?

EDIT: New error

I figured the first issue out. It was due to a overlooked library namely: libQt5XcbQpa.so.5.

However now I get a new error:

Cannot mix incompatible Qt library (version 0x50602) with this library (version 0x50b02)

I noticed that there is an old Qt installation (5.6) on the PC where I want to install the application. I have copied my libraries (5.11) into the same folder as my application is and my bash script calls:

LD_LIBRARY_PATH=$mydirname
export LD_LIBRARY_PATH

I thought that this folder is now in the search path for dynamically linked libraries. However, there is this other installation (5.6) as well. Will these libraries be found before or after the libraries in my folder? I'm asking because the 5.6 installation is, for example, missing a QtCharts library, which is provided in my folder, but with version 5.11. May this be the reason for the issue?

Here is a image of my folder:

folder structure

FINAL EDIT

I got it working! The issue was that I have libQt5DBus.so instead of libQt5DBus.so.5. Therefore it found all libraries in my directory with Version 5.11 except the libQt5DBus.so library, which was found in the old installation with version 5.6.

Thanks for all your help.

user7431005
  • 3,899
  • 4
  • 22
  • 49
  • Note that unless you're using `LD_LIBRARY_PATH` or did something at build time with `rpath`, the Linux loader does not by default look for shared libraries in the current directory. – Xaqq Feb 18 '19 at 14:55
  • good point but I'm using a bash script like recommended in the tutorial, I'll add this information to the question – user7431005 Feb 18 '19 at 14:57
  • for some reason you probably are mixing the system installed version of Qt libraries and the one you installed yourself. You should only use the libraries you are installing (or only those from the system, but that's somewhat more complicated to do). Using ldd should help you to find the missing libraries. – AProgrammer Feb 18 '19 at 15:02
  • Ok this is a good hint. I have noticed that my application depends on `/home/.../Qt/5.11.2/...libQt5Core.so.5` and `libqxcb.so` depends on `/usr/lib/x95_64-linux-gnu/libQt5Core.so.5`. – user7431005 Feb 18 '19 at 15:06
  • I have adapted the question base on the new findings – user7431005 Feb 18 '19 at 15:42

0 Answers0