Deploying Qt 5.6 on Linux compatibility issue
-
I'd like to deploy a Qt 5.6 application that I built on an Ubuntu 15.04 machine. I created the directory containing all the necessary libraries (shared objects), the plugins and the platforms directory and I created a scrip that sets
LD_LIBRARY_PATH
andQT_PLUGINS_PATH
accordingly. Everything appears to work well on the Ubuntu 15.05 machine on which I compiled everything but the application refuses to start on an Ubuntu 14.04 machine that doesn't have QtCreator installed. I get the following error message:Cannot mix incompatible Qt library (version 0x50201) with this library (version 0x50600) Aborted (core dumped)
Now, it looks like the application tries to link to some Qt 5.2 libraries that are present on the system instead of using the Qt 5.6 ones that are in the package. However, when I use
ldd
I can see that it links to the Qt libraries in the application directory:linux-vdso.so.1 => (0x00007ffd68fa8000) libQt5Widgets.so.5 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libQt5Widgets.so.5 (0x00007f9621531000) libQt5Gui.so.5 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libQt5Gui.so.5 (0x00007f9620d39000) libQt5Network.so.5 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libQt5Network.so.5 (0x00007f96209da000) libQt5Core.so.5 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libQt5Core.so.5 (0x00007f96202c8000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f961ffab000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f961fd95000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f961f9d0000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f961f7b1000) libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f961f560000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f961f35e000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f961f155000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f961ee4d000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f961ec3b000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f961e905000) libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f961e676000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f961e370000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f961e156000) libicui18n.so.56 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libicui18n.so.56 (0x00007f961dcbc000) libicuuc.so.56 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libicuuc.so.56 (0x00007f961d903000) libicudata.so.56 => /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/libicudata.so.56 (0x00007f961bf20000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f961bd1c000) /lib64/ld-linux-x86-64.so.2 (0x0000556229d63000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f961bb13000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f961b8d5000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f961b6b5000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f961b48b000) libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f961b25d000) libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f961b059000) libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f961ae53000) libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f961ac51000) libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f961aa39000) libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f961a834000) libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f961a631000) libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f961a42d000) libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f961a227000) libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f961a025000) libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f9619e1e000) libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f9619c11000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f9619a0c000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f9619806000)
My tree structure looks like this (the executable is uGFXStudio):
ugfx_studio/ ├── libicudata.so.56 -> libicudata.so.56.1 ├── libicudata.so.56.1 ├── libicui18n.so.56 -> libicui18n.so.56.1 ├── libicui18n.so.56.1 ├── libicuuc.so.56 -> libicuuc.so.56.1 ├── libicuuc.so.56.1 ├── libQt5Core.so -> libQt5Core.so.5.6.0 ├── libQt5Core.so.5 -> libQt5Core.so.5.6.0 ├── libQt5Core.so.5.6 -> libQt5Core.so.5.6.0 ├── libQt5Core.so.5.6.0 ├── libQt5Gui.so -> libQt5Gui.so.5.6.0 ├── libQt5Gui.so.5 -> libQt5Gui.so.5.6.0 ├── libQt5Gui.so.5.6 -> libQt5Gui.so.5.6.0 ├── libQt5Gui.so.5.6.0 ├── libQt5Network.so -> libQt5Network.so.5.6.0 ├── libQt5Network.so.5 -> libQt5Network.so.5.6.0 ├── libQt5Network.so.5.6 -> libQt5Network.so.5.6.0 ├── libQt5Network.so.5.6.0 ├── libQt5Widgets.so -> libQt5Widgets.so.5.6.0 ├── libQt5Widgets.so.5 -> libQt5Widgets.so.5.6.0 ├── libQt5Widgets.so.5.6 -> libQt5Widgets.so.5.6.0 ├── libQt5Widgets.so.5.6.0 ├── libQt5XcbQpa.so -> libQt5XcbQpa.so.5.6.0 ├── libQt5XcbQpa.so.5 -> libQt5XcbQpa.so.5.6.0 ├── libQt5XcbQpa.so.5.6 -> libQt5XcbQpa.so.5.6.0 ├── libQt5XcbQpa.so.5.6.0 ├── platforms │ ├── libqeglfs.so │ ├── libqlinuxfb.so │ ├── libqminimalegl.so │ ├── libqminimal.so │ ├── libqoffscreen.so │ └── libqxcb.so ├── plugins │ ├── bearer │ │ ├── libqconnmanbearer.so │ │ ├── libqgenericbearer.so │ │ └── libqnmbearer.so │ ├── iconengines │ │ └── libqsvgicon.so │ ├── imageformats │ │ ├── libqdds.so │ │ ├── libqgif.so │ │ ├── libqicns.so │ │ ├── libqico.so │ │ ├── libqjp2.so │ │ ├── libqjpeg.so │ │ ├── libqsvg.so │ │ ├── libqtga.so │ │ ├── libqtiff.so │ │ ├── libqwbmp.so │ │ └── libqwebp.so │ ├── platforms │ │ ├── libqeglfs.so │ │ ├── libqlinuxfb.so │ │ ├── libqminimalegl.so │ │ ├── libqminimal.so │ │ ├── libqoffscreen.so │ │ └── libqxcb.so │ └── xcbglintegrations │ ├── libqxcb-egl-integration.so │ └── libqxcb-glx-integration.so └── uGFXStudio
Can anybody help me finding and fixing this issue? Any help would be highly appreciated.
-
Hi, not 100% this is the cure, but the platform plugin libqxcb.so needs libQt5XcbQpa.so.5 and libQt5DBus.so.5, and starting with Qt 5.5, it's not sufficient to put them together with your executable .elf file.
(It's because the rpath setting in libqxcb.so has become significant.)So either you change the rpath setting of libqxcb.so (for example with chrpath) or, what I usually do, put the 2 .so files together with libqxcb.so in the platforms subdirectory.
Also you don't need to copy/recreate the links, just copy and rename the "real" McCoy, e.g.
cp ~/Qt/5.6/gcc_64/lib/libQt5DBus.so.5.6.0 /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/platforms/libQt5DBus.so.5
cp ~/Qt/5.6/gcc_64/lib/libQt5XcbQpa.so.5.6.0 /home/joel/Downloads/ugfx_studio_0.15_linux/ugfx_studio/platforms/libQt5XcbQpa.so.5
-
Now it works, thank you very much!
The issue was indeed thatlibqxcb.so
requiredlibQt5XcbQpa.so.5
andlibQt5DBus.so.5
to be present in the same directory.Also thank you for letting me know about just dropping the links and renaming the real deal. I am always very confused about the version naming of shared objects.
Thank you again for your help, I appreciate it a lot!