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 deployment - using qt.conf for dynamic linking
Forum Updated to NodeBB v4.3 + New Features

Qt 5 linux deployment - using qt.conf for dynamic linking

Scheduled Pinned Locked Moved General and Desktop
14 Posts 2 Posters 10.9k Views 1 Watching
  • 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #4

    Sorry. With linux I use qt.conf only for plugins.
    Please insert in your .pro file the rows below:

    unix:!mac {
    LIBS += -Wl,-rpath=\$$ORIGIN/libs
    }

    and then please store your required libraries in libs subfolder.

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

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

      I tried it. It didn't work. In my app folder I have:

      myapp
      libs/
      platforms/

      Any ideas?

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

        The Qt libraries needed (libicuxxx, libQt5Corexxx, libQt5Guixxx, libQt5WidgetsXXX) are listed in the Qt 5 library as links to other versions of those files. Maybe resolving the dependencies is having a problem with that.

        1 Reply Last reply
        0
        • mrdebugM Offline
          mrdebugM Offline
          mrdebug
          wrote on last edited by
          #7

          Can you try to download and compile that?
          http://kde-apps.org/content/show.php?content=149622
          I'm sure that works correctly with Qt 4.8.4

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

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

            I did a build in Qt 4.8.2 (installed from the software manager in Linux Mint 14 32 bit) and everything works perfectly. I tried it with a shell wrapper also, and also a qt.conf and everything works. There's definitely a problem with dynamic linking with Qt 5.

            1 Reply Last reply
            0
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by
              #9

              This means that for now I can't use Qt 5. When you will find the solution please post here.

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

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

                If I find a solution I will post it. Maybe when Qt 5.1.0 comes out it will be solved (scheduled for some time in April if no delays). Note that I didn't have any problems with dynamic linking in Qt 5 with a Windows build. Just Linux.

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

                  I was missing libQt5DBus in my dependencies. It was not listed by the ldd command. I found that out on another forum. Dynamic linking in Qt 5 works for me now, both using your addition to the .pro file, and a wrapper shell script. But I can't get a qt.conf to work. I saw somewhere where it doesn't for Windows builds. Maybe not Linux either. It works for Qt 4.8.2. I'll check the bug reports to see if it is already reported. Qt 5 dynamic linking works.

                  1 Reply Last reply
                  0
                  • mrdebugM Offline
                    mrdebugM Offline
                    mrdebug
                    wrote on last edited by
                    #12

                    Yes, you're right. qt.conf works only with plugins for me.

                    Need programmers to hire?
                    www.labcsp.com
                    www.denisgottardello.it
                    GMT+1
                    Skype: mrdebug

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

                      I filed a bug report. Here's the answer I got:

                      Quote: "

                      qt.conf can not make the linker look for libraries in a different location, it's simply technically not possible. The "Libraries" entry (and all other entries) are only fixing up the paths that the QLibraryInfo API returns.

                      From the qt.conf documentation:

                      The qt.conf file overrides the hard-coded paths that are compiled into the Qt library. These paths are accessible using the QLibraryInfo class.
                      

                      If you want to make your application/libraries look for Qt at a different location, your only choice are the options that the linker offers you, i.e. on Linux basically LD_LIBRARY_PATH or rpath (e.g. with $ORIGIN to make it independent from absolute paths)." UnQuote. FYI.

                      1 Reply Last reply
                      0
                      • mrdebugM Offline
                        mrdebugM Offline
                        mrdebug
                        wrote on last edited by
                        #14

                        Ok. Thanks for the investigation and the explanation.

                        Need programmers to hire?
                        www.labcsp.com
                        www.denisgottardello.it
                        GMT+1
                        Skype: mrdebug

                        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