Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5 - Linux app deployment - can you dynamically link dependencies?

Qt 5 - Linux app deployment - can you dynamically link dependencies?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    te777
    wrote on last edited by
    #1

    I have a Linux Qt 5 app I'm trying to deploy on other Linux systems. I'm using VirtualBox machines develop and test. My app runs with the dependencies on the devoper machine, but not on a non-developer test machine. I have a script which loads the dependencies identified by using the ldd command. Are there any dependencies not listed by the ldd command? I'm trying to dynamically link the dependencies. Is that possible? Or do I have to configure and build from the source code with the static option? Any help would be appreciated. Thanks.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Yes, dynamic libs should work. In Qt5, you need to copy platform plugin to <biniary dir>/platforms/ in addition to other dependencies.

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        te777
        wrote on last edited by
        #3

        Here's the dependencies I am using:

        linux-gate.so.1
        libQt5Widgets.so.5
        libQt5Gui.so.5
        libQt5Core.so.5
        libstdc++.so.6
        libgcc_s.so.1
        libc.so.6
        libpthread.so.0
        libgobject-2.0.so.0
        libglib-2.0.so.0
        libX11.so.6
        libm.so.6
        libGL.so.1
        libicui18n.so.49
        libicuuc.so.49
        libdl.so.2
        libgthread-2.0.so.0
        librt.so.1
        /lib/ld-linux.so.2
        libffi.so.6
        libpcre.so.3
        libxcb.so.1
        libglapi.so.0
        libXext.so.6
        libXdamage.so.1
        libXfixes.so.3
        libX11-xcb.so.1
        libxcb-glx.so.0
        libXxf86vm.so.1
        libdrm.so.2
        libicudata.so.49
        libXau.so.6
        libXdmcp.so.6

        Here's the script I'm using:

        #!/bin/sh

        if [ getconf LONG_BIT = "64" ]
        then
        LIBS=./data/libs_64
        BIN=./data/bin/Lottery_64
        else
        LIBS=./data/libs_32
        BIN=./data/bin/Lottery_32
        fi

        Run your app

        export LD_LIBRARY_PATH=$LIBS:"$LD_LIBRARY_PATH"
        $BIN $@

        The script works on the developer machine where Qt 5 is installed, but on the test machine where Qt 5 is not installed I click the script, choose run, and nothing happens. Both machines are 32 bit Linux Mint 14 in VirtualBox. The dependencies are contained in libs_32. I have the platforms folder in the Lottery_32 directory. Are there any dependencies I'm missing? I checked them against the ldd command on the app.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          That is not the usual way of doing things, but it's your choice. I don't see anything missing, but it could be that the libraries depend on other stuff. Build in debug and see if you can attach gdb to the app.

          (Z(:^

          1 Reply Last reply
          0
          • T Offline
            T Offline
            te777
            wrote on last edited by
            #5

            What is the usual way of doing it? I'm new to Qt in Linux. I've developed in Windows before. This is my first Linux Qt app.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Dependencies are traditionally handled by package managers. That is why you can easily install apps with a simple .deb or .rpm file. All shared libraries are really shared this way, by all applications. Saves space and makes the OS faster.

              You won't find Qt5 in repositories yet, though.

              (Z(:^

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved