I have a 32-bit linux Virtual Box which I am compiling my Qt c++ code on.
I am copying the target files to a 64-bit linux box (the 32-bit executable should still run on this PC).
The build is using dynamic linking, so I was going to start copying across the Qt lib files that I need. I planned to just do this manually by running the program and letting it tell me which lib files are missing + I know many of the files that I need so it won't take me long (normally).
So in my 64-bit box target folder I have the files:
./Rpe: error while loading shared libraries: libQt5Multimedia.so.5: cannot open shared object file: No such file or directory
adadacha@duanedibbley:~/sandbox$ ldd Rpe
linux-gate.so.1 => (0xf7731000)
libQt5Multimedia.so.5 => not found
libQt5Network.so.5 => not found
libQt5Xml.so.5 => not found
libQt5Core.so.5 => not found
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7616000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf75f9000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf744a000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7404000)
I would create a directory for your "product" with the executable in a
bin sub-directory and the Qt libraries (and any other libraries) in a
In the parent directory I would add a wrapper script to set
$LD_LIBRARY_PATH and execute the binary (not tested):
#!/bin/sh dirname="$(dirname "$0")" exename="$(basename "$0")" LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$dirname/lib" export LD_LIBRARY_PATH exec "$dirname/bin/$exename" $*