Results 1 to 5 of 5

Thread: How to run Qt 5.1.0 application on Debian

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Question How to run Qt 5.1.0 application on Debian

    Hi,

    I created two applications using Qt 5.1.0.

    On my "main" computer (Linux Mint 64-bit) I have installed the Qt library using the installer from http://qt-project.org/downloads (I installed both, the 32-bit version and the 64-bit version).

    Now I want to run my applications on an other computer (Debian 32-bit) so I compiled a 32-bit version of my applications and copied them to /usr/bin. I also copied the 32-bit version of all required Qt libraries to /usr/lib. I stored the platform plug-ins libqxcb.so, libqoffscreen.so, libqminimal.so and libqlinuxfb.so in the directory /usr/lib/qt5/plugins/platforms/ and set the environment variable QT_PLUGIN_PATH to /usr/lib/qt5/plugins by editing /etc/environment. Of course I set the permission to allow all users to execute the files.

    Which directories are recommended to put the applications, the Qt library files and the plug-ins in?

    When I'm trying to start one of my applications it seems to find all libraries (and plug-ins) but it is unable to load the xcb plugin. This is the error message I'm getting:
    Failed to load platform plugin "xcb". Available platforms are:
    linuxfb
    minimal
    offscreen
    xcb

    What could be the reason for that problem?
    I have already checked if I've installed all required dependencies (at least the packages listed here: http://qt-project.org/doc/qt-5.1/qtd...ments-x11.html).

    I noticed that some Qt 4 libraries have been already installed on the system (likely installed by some other Qt-based applications like VLC). But I found them not in /usr/lib but rather in the subdirectory i386-linux-gnu.
    Why/in which case is that subdirectory used?

    On my main computer where I installed Qt using the installer the libraries are stored at /home/username/Qt5.1.0/5.1.0/gcc/lib. How has the installer configured my system to let all Qt applications know to look for the the libraries in that specific location? There's no entry in /etc/environment, ~/.profile or /etc/profile. There is also no entry for the plug-in directory (which I had to create on the other computer).

    Thanks for answering

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to run Qt 5.1.0 application on Debian

    Quote Originally Posted by Infinity View Post
    Which directories are recommended to put the applications, the Qt library files and the plug-ins in?
    If you're doing a custom deployment, I'd store all the libraries and plugins in the application directory, say:

    /usr/local/myapp/lib for Qt libs
    /usr/local/myapp/plugins for Qt plugins
    /usr/local/myapp/bin for the application binary
    /use/local/myapp/data (or something else) for read-only application data.

    The paths can be set using qt.conf which seems a better choice than manipulating the system environment.

    Of course for user-space installation you can substitute /usr/local/myapp with /home/user/myapp. /opt/myapp is also a viable approach.

    What could be the reason for that problem?
    A missing dependency, e.g. missing libxcb.so
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Infinity (2nd September 2013)

  4. #3
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How to run Qt 5.1.0 application on Debian

    Thanks for your answer.

    A missing dependency
    libxcb.so wasn't missing. I checked the dependencies using readelf and discovered that libQt5DBus.so is required by xcb. That one was missing, my applications are running now.

    The paths can be set using qt.conf which seems a better choice than manipulating the system environment.
    I will use qt.conf instead of /etc/environment to tell Qt where to look for plug-ins. But this works only for the plug-in libraries, not for the regular Qt libraries (correct?).
    How tells the installer the system where to look for the Qt libraries (I found no qt.conf file)?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to run Qt 5.1.0 application on Debian

    Quote Originally Posted by Infinity View Post
    But this works only for the plug-in libraries, not for the regular Qt libraries (correct?).
    Correct.

    How tells the installer the system where to look for the Qt libraries (I found no qt.conf file)?
    For Linux based systems you can set rpath or runpath so that the loader looks for libraries in a place set during compilation or you can use LD_LIBRARY_PATH to set the directory during application startup. Qt-based apps are by no means different than any other Linux application in this regard.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    Infinity (5th September 2013)

  7. #5
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How to run Qt 5.1.0 application on Debian

    I'm using the directory you suggested now and my applications are working. But I'm still interested so I'll check out rpath, runpath and LD_LIBRARY_PATH.

Similar Threads

  1. Replies: 1
    Last Post: 3rd August 2013, 11:39
  2. QtIOCompressor fix for Mac (Debian Linux?)
    By qdm in forum Qt Programming
    Replies: 0
    Last Post: 23rd June 2010, 02:17
  3. How to create a debian package for Qt4 application.
    By genessr in forum Qt Programming
    Replies: 2
    Last Post: 14th July 2009, 09:48
  4. QT 4.4 Package for Debian
    By Tavo92 in forum Installation and Deployment
    Replies: 3
    Last Post: 6th August 2008, 18:03
  5. qt >= 4.3 for debian etch packages
    By majorTom in forum Installation and Deployment
    Replies: 1
    Last Post: 15th September 2007, 13:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.