Important: Please read the Qt Code of Conduct -

linuxdeployqt copies default (old) libraries instead of new ones

  • Hi, I'm trying to deploy an app with linuxdeployqt making an AppImage. I've successfully done that in Ubuntu 16.04 and 20.04, but since my app has to run on CentOS 7 (the ones created in Ubuntu don't start) I'm now trying to do the same things I did in Ubuntu on CentOS 7.9.
    The problem I'm facing is that linuxdeployqt copies the Qt libraries from the /usr/lib64 folder (they are from version 5.9.7 preinstalled) instead of copying them from the Qt/5.15.2/gcc_64/bin folder:

    Log: Checking rpath in "/home/davide/Desktop/Deploy/lib/"
    Log: Changing rpath in "/home/davide/Desktop/Deploy/lib/" to "$ORIGIN"
    Log: Setting deploymentInfo.qtPath to: "/usr/lib64/"
    Log:  copied: "/usr/lib64/"
    Log:  to "/home/davide/Desktop/Deploy/lib//"

    If then I try to run the AppImage i get this:

    [davide@localhost Deploy]$ ./APP_NAME.AppImage 
    ./APP_NAME.AppImage: /tmp/.mount_APP_uw1ysE/lib/ version `Qt_5.15' not found (required by ./APP_NAME.AppImage)

    because the library copied is the one bundled with the system:

    [davide@localhost Deploy]$ /home/davide/Desktop/Deploy/lib/ 
    This is the QtCore library version Qt 5.9.7 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.8.5 20150623 (Red Hat 4.8.5-44))

    qmake points to the correct version (I added its path to $PATH):

    [davide@localhost Deploy]$ qmake -v
    QMake version 3.1
    Using Qt version 5.15.2 in /home/davide/Qt/5.15.2/gcc_64/lib

    How can I force linuxdeployqt to use the correct libraries?

  • Moderators

    Try manually passing qmake path to linuxdeployqt with -qmake flag:

    linuxdeployqt -qmake=/home/davide/Qt/5.15.2/gcc_64/bin/qmake

  • I tried but it still copies the libraries from /usr/lib64

  • Moderators

    Run ldd on your binary file (before deployment) to see what it is really linked against.

Log in to reply