I am trying to deploy a C++ application compiled with gcc on Linux by putting the required .so files into the executable directory. I added the linker flag -Wl,-rpath=$ORIGIN
so that the program may look for the linked libraries in the directory where it's located. This works so far as that all libraries that are directly linked with my executable are found (checked via ldd).
However, when I try to launch the application I get the following error:
This application failed to start because it could not find or load the Qt platform plugin "xcb".
Available platform plugins are: linuxfb, minimal, offscreen, xcb.
Reinstalling the application may fix this problem.
The platform plugins are located in the folder ./platforms
(relative to the executable path). Those some other shared object files which are apparently loaded by Qt, one of them being libqxcb.so
. Now, the problem is that this file again depends on libQt5Gui.so
, libQt5Core.so
etc. These are located in my application path, but I suspect that the libqxcb.so
is somehow not able to find them there, thus it fails. Is there a possibility how I could fix this?
If I use the following script to run the application, it works (note: Ct
is the name of the executable):
#!/bin/sh
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $DIR
LD_LIBRARY_PATH=LD_LIBRARY_PATH:. ./Ct
But I would like to achieve this without having to use a script to run the application.