Qt Package Dependency Issue on Linux
-
wrote on 31 Jul 2022, 22:29 last edited by anshah
Hello,
I'm building my application which uses the Qt GUI framework on Ubuntu 20.04. When I try to install (usingapt-get
) the Debian file the 20.04 build produces on Ubuntu 18.04 I encounter package dependency issues.[MyApp]: /usr/lib/x86_64-linux-gnu/libQt5WebKit.so.5: no version information available (required by [MyApp]) [MyApp]: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.12' not found (required by [MyApp])
Mainly because Ubuntu 18.04 provides Qt 5.9 in the repository and my application is built with Qt 5.12 which Ubuntu 20.04 repository provides.
Is there any solution to this issue? Is it possible for Qt to install from the focal (20.04) repository.
Any help would be most appreciated. -
Hello,
I'm building my application which uses the Qt GUI framework on Ubuntu 20.04. When I try to install (usingapt-get
) the Debian file the 20.04 build produces on Ubuntu 18.04 I encounter package dependency issues.[MyApp]: /usr/lib/x86_64-linux-gnu/libQt5WebKit.so.5: no version information available (required by [MyApp]) [MyApp]: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.12' not found (required by [MyApp])
Mainly because Ubuntu 18.04 provides Qt 5.9 in the repository and my application is built with Qt 5.12 which Ubuntu 20.04 repository provides.
Is there any solution to this issue? Is it possible for Qt to install from the focal (20.04) repository.
Any help would be most appreciated.@anshah said in Qt Package Dependency Issue on Linux:
Is there any solution to this issue?
Yes, deploy your application to create a package which also contains all needed Qt libraries.
See https://doc.qt.io/qt-6/linux-deployment.html -
wrote on 2 Aug 2022, 16:07 last edited by anshah 8 Feb 2022, 21:35
Thank you for your reply.
Few Questions:-
list itemDoes this have a significant impact on the size of the package since the libraries are included?
-
list itemOur build generates Debian and RPM from an Ubuntu 20.04 Container. So we deploy on Ubuntu and RHEL. If I statically build my application with Qt you are saying the Distro/Version should not matter?
-
-
Thank you for your reply.
Few Questions:-
list itemDoes this have a significant impact on the size of the package since the libraries are included?
-
list itemOur build generates Debian and RPM from an Ubuntu 20.04 Container. So we deploy on Ubuntu and RHEL. If I statically build my application with Qt you are saying the Distro/Version should not matter?
- Yes, it has impact on the size, but if the libraries are required by your application you have to deliver them
- Well, whether it will run on any Linux distribution or not depends I would say. You would need to build ALL dependencies statically to reduce dependencies to distribution provided libraries. Static linking can also reduce the overall size of your package because linker removes parts of libraries (functions for example) which are not used by your application. But on the other side your application will bring its own versions (statically linked) of all the needed libraries which would be otherwise provided by the Linux distribution in case of dynamic linking.
-
-
- Yes, it has impact on the size, but if the libraries are required by your application you have to deliver them
- Well, whether it will run on any Linux distribution or not depends I would say. You would need to build ALL dependencies statically to reduce dependencies to distribution provided libraries. Static linking can also reduce the overall size of your package because linker removes parts of libraries (functions for example) which are not used by your application. But on the other side your application will bring its own versions (statically linked) of all the needed libraries which would be otherwise provided by the Linux distribution in case of dynamic linking.
-
@anshah said in Qt Package Dependency Issue on Linux:
Is there any solution to this issue?
Yes, deploy your application to create a package which also contains all needed Qt libraries.
See https://doc.qt.io/qt-6/linux-deployment.htmlwrote on 13 Aug 2022, 19:42 last edited by@jsulm said in Qt Package Dependency Issue on Linux:
I have Qt installed from the repository on Ubuntu 14.04. The Linux deployment document states to go to the Qt path and configure to build the static libs:
cd /path/to/Qt ./configure -static -prefix /path/to/Qt <other parameters> make
I'm not sure where this "/path/to/Qt" is which contains the "configure".
-
wrote on 13 Aug 2022, 22:56 last edited by
I have Qt installed from the repository on Ubuntu 14.04.
14.04... really? You do not need any version of Qt installed in order to build Qt itself. You do need a suitable compiler which 18.04 or 20.04 will provide. The default GCC version with Ubuntu 14.04 is, I think, GCC 4.x which it too old.
I'm not sure where this "/path/to/Qt" is which contains the "configure".
It is where you have unpacked the Qt source code. You are trying to build Qt itself from source code to make a version for static linking.
-
@anshah said in Qt Package Dependency Issue on Linux:
Is there any solution to this issue?
Yes, deploy your application to create a package which also contains all needed Qt libraries.
See https://doc.qt.io/qt-6/linux-deployment.htmlwrote on 14 Aug 2022, 17:51 last edited by@jsulm
Last question...hopefully. =)
Once the static libraries are built I understand when we deploy we included all needed libraries and include files. What about binaries such as "moc" and "rcc"?This was was my previous Makefile config:
QT_LIB=/usr/lib/x86_64-linux-gnu MOC=$(QT_LIB)/qt5/bin/moc RCC=$(QT_LIB)/qt5/bin/rcc
-
I have Qt installed from the repository on Ubuntu 14.04.
14.04... really? You do not need any version of Qt installed in order to build Qt itself. You do need a suitable compiler which 18.04 or 20.04 will provide. The default GCC version with Ubuntu 14.04 is, I think, GCC 4.x which it too old.
I'm not sure where this "/path/to/Qt" is which contains the "configure".
It is where you have unpacked the Qt source code. You are trying to build Qt itself from source code to make a version for static linking.
wrote on 14 Aug 2022, 18:07 last edited by anshah@ChrisW67 The reason for 14.04 is because we deploy to RHEL 7 and 8 and UBuntu 18.04, 20.04.
UBuntu 14.04 is the common denominator to support the distro/versions.
I tried upgrading to 18.04 but as a result of the compiler version you mentioned...our application won't deploy on RHEL 7.
It's like a game of whack-a-mole deploying on Linux distro/versions.