(Solved) How to deploy to Debian
-
I have a Qt 5.3.1 developed dynamic linking app that runs on Ubuntu and Linux Mint Cinnamon. But it won't run on Linux Mint XFCE in VirtualBox with 3D acceleration enabled, and it won't run with or without 3D accelaration in VirtualBox for Linux Mint LMDE or Debian Jessie.
Any ideas, comments or possible solutions would be welcome.
Or are the problems more than likey VirtualBox originated? Anybody with Linux native setups (preferably Debian and not virtual machines in VirtualBox) or other VM setups like VMWare player are welcome to test the app for me to see if it runs there:
Download and try to run either a 32 bit or 64 bit Linux version. I only have a Windows 7 SP1 64 bit host running VirtualBox 4.3.26.
Any replies welcome. Thanks in advance. Sorry if posting the link to my website is frowned upon. It is free software though. I have nothing to gain by someone downloading my software. If the link isn't acceptable, let me know if there's another way someone can test the application for me.
Best Regards,
Tom -
Update: For the Debian Linux virtual machines I had to go into Synaptics and install "qt5-default" package. For XFCE I just re-installed the VBox Guest Additions while in the user I was testing in. All is good for opeating the programs. But as a side note, any system I use Cinnamon with, my app doesn't display correctly (missing data outputs to text boxes). This happens with 3D acceleration enabled for the virtual machine in VirtualBox. Any comments on this Cinnamon issue are welcome.
-
Hi,
What kind of data are missing ? Characters not displaying ?
-
For binary linux applications I would distribute all your libs with it. To not do that with a pre-built app is asking for trouble in linux.
Typically I use a dir structure like so:
app bin lib plugin resources doc
Then in lib will have all your library dependencies including Qt/icu/whatever. You can find out what libs your binary needs by running
ldd <app>
. Then you need toldd
on each library as well.Libs like libstdc++, libz, libgcc, etc are ok not to include (usually) as they have good backwards compatibility. Anything in /lib, /usr/lib, /lib64 is probably ok to rely on, on the target system, except ICU, that should be included with your app.
Once you put all those libs in your lib directory you will need to use
chrpath
to reassign their locations with the binary for you application. This will make them self contained. You may not need to usechrpath
to reset paths, but I included it just in case.And then finally make a small script in your
app
root directory that does something like:#!/bin/sh LD_LIBRARY_PATH="$PWD/lib" ./bin/myapp
And then that will launch your app for you.
And finally what I do to test that everything is working properly is turn off permissions to your Qt lib directory, so for me /usr/local/Qt-x.x.x, I just do
sudo chmod 000 /usr/local
. I do this because I don't want any /usr/local libs. Be careful though if you want some others.Then test run your app, if it can't load a library it's probably still relying on a system one.
When you are done, restore your permissions
sudo chmod 755 /usr/local
DO NOT use -R to recurse permission on either of those chmods or you will break your system. -
I have the following line added to my .pro file:
unix:!mac { LIBS += -Wl,-rpath=\$$ORIGIN/libs
}and my libs folder has the follwing libs:
libicudata.so.52.1
libicui18n.so.52.1
libicuuc.so.52.1
libQt5Core.so.5.3.1
libQt5DBus.so.5.3.1
libQt5Gui.so.5.3.1
libQt5Network.so.5.3.1
libQt5Widgets.so.5.3.1Am I missing something? The app runs fine on Linux Mint (both CInnamon and Xfce) and Ubuntu as is. It's any Debian version, including LMDE, which needs the "qt5-default" package. I'll run ldd on the binary and see what's missing that I should include in libs. I'll take a while since a lot of the files are links and I'll have to copy and rename to get the files I need. I will post back.
-
I found the problem for Debian. The lib files didn't have completely correct number extensions. Found out by using ldd command. Fixed and all is good. Deploys on Debian (and hopefully any Linux system) Ok. Thanks you guys for the help. Much appreciated.
Best Regards,
Tom -
ldd is your best friend for stuff like that. :)
Glad it's fixed!
-
@ambershark Thanks.