Unsolved Qt Linux Deployment
-
Hi
I was reading the qt document on deplying on linux and looking for the easiest and cross distro way and I found this: creating a .sh file and putting the executable and libraries in a folder:#!/bin/sh
appname=basename $0 | sed s,\.sh$,,
dirname=
dirname $0
tmp="${dirname#?}"if [ "${dirname%$tmp}" != "/" ]; then
dirname=$PWD/$dirname
fi
LD_LIBRARY_PATH=$dirname
export LD_LIBRARY_PATH
$dirname/$appname "$@"this was in the document. my question is what to change here so I can have my own .sh file for my application? what parts sould I modify?
-
Hi @shahriar25,
You don't need to modify the script. You just need to make sure that the script file has the same name as your executable, and put them in the same directory. For example, if your executable is called
MyApp
, your script file must be calledMyApp.sh
.Note: Personally, I recommend setting
rpath
instead of using a launcher script. The method is very simple: Simply add the line,QMAKE_LFLAGS += -Wl,-rpath,"'\$$ORIGIN'"
to your .pro file. See this blog for full details: http://www.tripleboot.org/?p=138 -
Hi @JKSH
Thank you for helping. I will try this way and ask here if I had a problem -
Hi @JKSH
I wanted to try your way but I couldn't find the libqxcb.so. I mean it is in: path/to/qt/plugins/platforms but it's size is 10 KB!!! and the apps won't run without it. what should I do? -
Did you read the tripleboot.org blog? That describes how to deploy Qt apps and in particular how to deploy the Qt plugins such as libqxcb.so.
-
Hi @KeithS
my problem is that my libqxcb.so is 10 KB instead of 1.3 MB ! I have installed Qt with the .run file to the default path. what am I doing wrong? -
-
@shahriar25 said:
my problem is that my libqxcb.so is 10 KB instead of 1.3 MB !
That's not a problem.
libqxcb.so was 1.3 MB in Qt 5.3, but reduced to 10 KB in Qt 5.5.
-
Hi @JKSH @KeithS thank you both
It worked you were right I had the right file. but how ever I got another problem when I ran the executable from terminal:cannot mix incompatible Qt library ( version 0x50500 ) with this library ( version 0x50501 )
what is this problem? how do I fix it? thanks in advance
-
Hi,
Do you have 5.5.1 installed on your system ? What distribution are you using ?
-
Hi @SGaist
well I do have 5.5.1 installed on my fedora but I wanted to test deploying qt programs with shared library so I tested it on a live fedora with gnome.
the thing is that I don't have qt 5.5 anywhere I only have 5.5.1 and 5.6 beta! -
What version does the live fedora provide ?
-
well the qt is not installed on it and it is fedora 23 with gnome UI
-
Are you sure Qt's not installed on it ? I don't mean the development environment but I'd be surprised that the libraries are not there at all.
-
Hi @SGaist
Well I'm sure the qt IDE is not installed and also it's a live fedora I haven't installed it so it is the pure fedora. I don't know if qt libs are installed on it or not -
Then run
ldd your_application_name
on that version of Fedora. You'll see if you have Qt available.