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/libQt5Gui.so.5" Log: Changing rpath in "/home/davide/Desktop/Deploy/lib/libQt5Gui.so.5" to "$ORIGIN" Log: Setting deploymentInfo.qtPath to: "/usr/lib64/" Log: copied: "/usr/lib64/libQt5Core.so.5" Log: to "/home/davide/Desktop/Deploy/lib//libQt5Core.so.5"
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/libQt5Core.so.5: 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/libQt5Core.so.5 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?
Thanks -
Try manually passing qmake path to
linuxdeployqt
with-qmake
flag:linuxdeployqt -qmake=/home/davide/Qt/5.15.2/gcc_64/bin/qmake
-
Run
ldd
on your binary file (before deployment) to see what it is really linked against.