Mauker
Mauker

Reputation: 11487

Deploy Qt Application binaries on Ubuntu with shared libs

I want to deploy a Qt application I've made to run on any "Vanilla" Ubuntu. It could be a .deb package, or simply the binary with the required libraries. Thing is, I'm not sure how to do either.

I've tried to follow this tutorial: https://lemirep.wordpress.com/2013/06/01/deploying-qt-applications-on-linux-and-windows-3/ and I actually managed to make the application run on another computer but... It's supposed to play some videos and I got a message like:

defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

I've probably missed some libs. But I really don't know which ones. When I run ldd on my binary file, everything seems to be ok.

The results of the ldd are as follows:

libQt5MultimediaWidgets.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5MultimediaWidgets.so.5 (0x00007f02a0adf000)
libQt5Multimedia.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5Multimedia.so.5 (0x00007f02a07fc000)
libQt5Widgets.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5Widgets.so.5 (0x00007f029ffb9000)
libQt5Xml.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5Xml.so.5 (0x00007f029fd7b000)
libQt5Network.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5Network.so.5 (0x00007f029fa17000)
libQt5Gui.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5Gui.so.5 (0x00007f029f2f3000)
libQt5Core.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5Core.so.5 (0x00007f029ebbf000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f029e8a1000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f029e68a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f029e2c4000)
libQt5OpenGL.so.5 => /home/mauker/Qt/5.3/gcc_64/lib/libQt5OpenGL.so.5 (0x00007f029e06a000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f029dd98000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f029da92000)
libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f029d849000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f029d62a000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f029d3d9000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f029d0d1000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f029cd9b000)
libicui18n.so.52 => /home/mauker/Qt/5.3/gcc_64/lib/libicui18n.so.52 (0x00007f029c97b000)
libicuuc.so.52 => /home/mauker/Qt/5.3/gcc_64/lib/libicuuc.so.52 (0x00007f029c5f2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f029c3ee000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f029c1ec000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f029bfe3000)
/lib64/ld-linux-x86-64.so.2 (0x00007f02a0cff000)
libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f029bdd8000)
libpulsecommon-4.0.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so (0x00007f029bb70000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f029b92b000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f029b723000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f029b4e4000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f029b2c5000)
libicudata.so.52 => /home/mauker/Qt/5.3/gcc_64/lib/libicudata.so.52 (0x00007f0299a5a000)
libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f029984f000)
libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f02995e7000)
libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f02993e0000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f02991dc000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0298fd6000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f0298dbb000)
libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f0298b8a000)
libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f02986bb000)
libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f029848d000)
libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f0298284000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f0298069000)

I've tried to copy every single one of those libs to a folder called "lib", and then I've made this script to run my app:

#!/bin/sh
export QTDIR=""
export QT_PLUGIN_PATH=""
export LD_LIBRARY_PATH=`pwd`/libs
export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/libs/platforms
./App

I'm obviously missing something here, but I have no clue where to look. Can you guys help me out with this? Is there a simpler way to deploy my program on Ubuntu? Should I try to make the .deb package? If so, how do I do it for a Qt application?

EDIT: Ok, I've managed to solve the first error setting my QT_PLUGIN_PATH to pwd/lib - But now I've got this message:

No decoder available for type 'video/x-h264(...)'

Which could be solved by installing ffmpeg library separately. But I'd really like to bundle all the libs somehow, or like I said before, to make a .deb package that solves everything for the user.

Upvotes: 1

Views: 888

Answers (1)

codestation
codestation

Reputation: 3498

To solve your codec problem the target pc will need to have the corresponding gstreamer library installed, then its dependencies (ffmpeg), then the ffmpeg dependencies, an so on....

You will be in a world of pain as you will end bundling A LOT of libraries since some deps requires other deps. I suggest you to take the deb packaging route so all the dependencies will be handled automatically.

Check the ubuntu packaging guide or the debian one. You should split your deb packaging question in another post so you will get better responses.

Upvotes: 3

Related Questions