linuxdeployqt ldd Error

  • Thanks to some other posts, I was happy to find linuxdeplyqt. However, when I try to use it for my application, I get the error that ldd cannot find one of my libraries belonging to the application. The application works perfectly fine when building & running from Qt Creator but the output of ldd is as shown below. =>  (0x00007ffdf79cf000) => not found => /usr/lib/x86_64-linux-gnu/ (0x00007f59fd664000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fd11c000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fcc46000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fc8c4000) => /lib/x86_64-linux-gnu/ (0x00007f59fc5ba000) => /lib/x86_64-linux-gnu/ (0x00007f59fc3a4000) => /lib/x86_64-linux-gnu/ (0x00007f59fbfda000) => /lib/x86_64-linux-gnu/ (0x00007f59fbdbc000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fbb69000) => /lib/x86_64-linux-gnu/ (0x00007f59fb858000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fb51d000) => /lib/x86_64-linux-gnu/ (0x00007f59fb2f8000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fb09a000) => /lib/x86_64-linux-gnu/ (0x00007f59fae7f000) => /usr/lib/x86_64-linux-gnu/mesa/ (0x00007f59fac0b000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fa7a9000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fa414000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59fa1ae000) => /lib/x86_64-linux-gnu/ (0x00007f59f9faa000) => /lib/x86_64-linux-gnu/ (0x00007f59f9da1000)
    	/lib64/ (0x000056242837f000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f9b99000) => /lib/x86_64-linux-gnu/ (0x00007f59f9928000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f9706000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f945c000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f9236000) => /lib/x86_64-linux-gnu/ (0x00007f59f900d000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f8e0a000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f8c06000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f89ff000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f87fc000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f85cc000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f83ba000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f81b7000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f7fb0000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f7dae000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f7b95000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f798f000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f7789000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f757a000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f5ac2000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f58be000) => /usr/lib/x86_64-linux-gnu/ (0x00007f59f56b7000)

    The issue is that is a library created as part of my projects. The .pro file for the project creating this library is as follows. I can also not find any on my disk (also not in /usr/lib) but the application runs perfectly from Qt Creator (and definately uses the code in this library). I can only find symbolic links to unknown. Any suggestions on what could be wrong here?

    QT       += xml gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = dfmcore
    TEMPLATE = lib
    SOURCES += \
        // Lot's of files
    HEADERS += \
        // Lot's of files
    unix {
        target.path = /usr/lib
        INSTALLS += target

  • Ok, got a little step further. I found the actual library file (it is called and I copied that to usr/lib with the name This makes ldd find it and also linuxdeployqt seems happy.

    Question 1: how do I solve this properly. I mean, I expected the .pro file to state that it should install the library in /usr/lib but it clearly doesn't do so. How do I fix this?

    Anyway, I get the next error:

    ERROR: ldd outputLine: "/home/.../dfm: /usr/lib/x86_64-linux-gnu/ version `Qt_5' not found (required by /home/.../dfm)"

    There is a symbolic link /usr/lib/x86_64-linux-gnu/ that refers to a file /usr/lib/x86_64-linux-gnu/ So, it seems that ldd does not go through the symbolic links to find the actual files.

    Question 2: How to make ldd / linuxdeployqt find the actual library files through the symbolic links?

  • Hi, about that error message "version `Qt_5' not found" occurs when you have built your app using Qt 5.6 or later and the pre-installed Qt on your system (in /usr/lib/x86_64-linux-gnu/) is a version of Qt before 5.6 (you have 5.5.1).

    The reason that error does not occur when you start your app from Qt Creator, is because Qt Creator patches the $PATH variable when in runs your app, so that the first entry points to your Qt installation (making ldd much happier).
    For example, on my Ubuntu the $PATH normally is:
    but when Qt Creator launches a Qt app it's changed to:

    Normally this shouldn't matter because a Qt app executable file gets an RPATH to your Qt installation anyway, on my Ubuntu it's:

    chrpath myapp

    however a successful run of linuxdeployqt on the app neuters that connection (a wise move which makes it possible to run the app on a PC without Qt installed) and changes it to:

    chrpath myapp

    and this should suffice provided that the lib subdirectory has had all the necessary Qt files copied into it by linuxdeployqt.

  • @hskoglund

    I am not completely sure whether I understand your remark. When I run chrpath for my app (dfm) I get:

    chrpath dfm 
    dfm: RUNPATH=$ORIGIN/lib/

    But, I also get that $ORIGIN is empty and my $PATH seems to stay the same (Although echo $PATH does not show inclusion of the standard paths like /usr/local/sbin etc.). I have some settings in .bashrc to extend the standard $PATH using lines like:

    export PATH=$PATH:/home/modeltech/bin

  • When you start the app, $ORIGIN is replaced with the current directory, where the app is. (Another approach is to add the current directory to the $PATH, but $ORIGIN is more convenient, no clobbering of $PATH is needed)

    If chrpath shows $ORIGIN/lib/ that means you've run linuxdeployqt on your app, and that in the current directory there should be a subdirectory lib with all the needed Qt dlls (copied from the Qt installation by linuxdeployqt).

    To make sure that pre-installed, ancient Qt doesn't rear its ugly head, you could edit your $PATH setting in .bashrc so that the path to your kosher Qt installation's lib directory comes first, on my Ubuntu it would be:

     export PATH=/home/henry/Qt/5.9.1/gcc_64/lib:$PATH

    But beware, once version 5.10 of Qt is out, that PATH would be invalid, i.e. it's a short-term solution :-)

  • Moderators

    @ModelTech $ORIGIN is a variable for the linker it tells it to take the directory where the executable file is located.
    Please DO NOT CHANGE PATH for you app globally!
    Why do you want to have that lib in /usr/lib?
    "I expected the .pro file to state that it should install the library in /usr/lib" - why?
    Usually linuxdeployqt creates a package (just a directory) containing all stuff needed to execute your app, there is no need to pollute the system directories.

    To me it is not completely clear what the issue is: does linuxdeployqt not copy into your package?

  • @jsulm

    It can't even find ...

    And I just discovered that on my Mac, this libdfmcore library is also not copied to /usr/lib. You ask why I would want that. Well, I do not want that but if I do so, ldd & linuxdeplyqt can actually find it (plus the 'unix { ...}' part at the bottom in the .pro file originates from the template given by Qt Created when I created the project).

    Note that both on linux and mac, I cannot run my app from a terminal, only from qt creator. This already suggests that there is something wrong, but I have no clue what...

  • Moderators

    Please read "Creating the Application Package" here:
    That ldd does not find the lib is normal (as the lib is not located in any directories where ldd is looking for libs). It will find it if you do the deployment as described in the link above. You will then have a shell script used to start your app. This script sets LD_LIBRARY_PATH variable before starting your app to tell linker where to look for your libs.

  • @jsulm

    Now, there is something interesting. LD_LIBRARY_PATH is set in my .bashrc for compiling another tool. Removing that from my .bashrc makes linuxdeployqt find the libdfmcore (without cluttering the /usr/lib directory).

    Nevertheless, linuxdeployqt still gives:

    linuxdeployqt dfm
    Not using FHS-like mode
    app-binary: "/home/.../dfm/build/release/gui/dfm"
    appDirPath: "/home/.../dfm/build/release/gui"
    relativeBinPath: "dfm"
    ERROR: ldd outputLine: "/home/.../dfm/build/release/gui/dfm: /usr/lib/x86_64-linux-gnu/ version `Qt_5' not found (required by /home/.../dfm/build/release/gui/dfm)"
    ERROR: Please ensure that all libraries can be found by ldd. Aborting.

    So, it seems that I have an issue with an old Qt version? What is the best approach to solve that?

  • Moderators

    @ModelTech Looks like you need take care of this (
    "QMake configuration

    Important: linuxdeployqt deploys the Qt instance that qmake on the $PATH points to, so make sure that it is the correct one. Verify that qmake finds the correct Qt instance like this before running the linuxdeployqt tool:

    qmake -v

    QMake version 3.0
    Using Qt version 5.7.0 in /tmp/.mount_QtCreator-5.7.0-x86_64/5.7/gcc_64/lib

    If this does not show the correct path to your Qt instance that you want to be bundled, then adjust your $PATH to find the correct qmake."

    Probably linuxdeployqt takes the qmake delivered with your Linux distribution. You can adjust PATH before calling linuxdeployqt so it picks the correct qmake.

  • After undoing all the polluting of /usr/lib, I have tried most suggestions. Also qmake -v gives something totally different than what it should be.

    Nevertheless, I did find a way that works but it is not very user-friendly. First of all, I have prepared the package with all the required libraries (including my own in a lib subfolder. So, it looks like:

    /dfm                              // Executable
    /lib/              // My own lib to the executable
    /lib/               // Example of a required Qt library
    /lib/...                          // More of them (all identified through linuxdeployqt)
    /platforms/             // Qt platform library
    /plugins/               // A plugin
    /plugins/         // Another plugin

    With all this in place, run the application by executing the following commands from a terminal at the location of the executable:

    export LD_LIBRARY_PATH

    I tried to script the above, but for some reason that doesn't work. For now this approach is ok, but suggestions for a more user-friendly solution are appreciated.

  • Moderators

    @ModelTech Did you actually read the links I provided ( and As I said you're using wrong qmake, do it like described in my previous post: "If this does not show the correct path to your Qt instance that you want to be bundled, then adjust your $PATH to find the correct qmake."
    "I tried to script the above, but for some reason that doesn't work" - what does not work?
    In the link above, if you read it, you will find ready made script to start your app, all you have to do is to copy this script into a text file, name this file and put it in the same directory where NAME_OF_YOUR_APP is.

  • Calling qmake from the command line does not work in my environment. Changing the $PATH does not help in any way. I tried hard.

    I solved the scripting problem by studying one of the referred pages in more details, but it did't work as it was described there. I did however give me the right inspiration. Thanks :)

    Anyway, on my Mac, I basically experience the same problem! It all has clearly to do with the fact that I use a library that I build myself (as a subproject for the whole project) and which is not accessible from /usr/lib. I have tried to put this library file at various places in (subfolders of) the Content folder of the application bundle. I also tried to alter the qt.conf file using the Library and LibraryExecutables fields. None of this worked: macdeployqt can't find the library file and it really wants it at /usr/lib. The only thing that I get to work is to put the .dylib file in the MacOs subfolder and run the application by calling the executable from within the MacOs subfolder from the command line. Not the solution that a typical Mac user will like...

  • Lifetime Qt Champion


    Take a look at the Linking the application to Qt as a framework chapter of the deployment documentation. It shows how to use macOS tools in order to deploy an application.

    You can use them in addition to macdeployqt when you have unusual stuff happening.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.