Skip to main content
added 109 characters in body
Source Link
Nikos C.
  • 52.2k
  • 10
  • 77
  • 104

You need to build Qt itself statically. Instructions:

https://doc.qt.io/qt-5/linux-building.html

To do a static build, pass the -static flag to ./configure. You might want to install this in your home directory instead of system wide. In that case, also pass something like -prefix $HOME/custom_qt/5.12.23 so that this Qt build will be installed in your home directory when you do make install.

Building is going to take a long time, so make sure to use make -jN to build it (replace N with the amount of threads/cores your CPU has.) It will still take a long time even with that, so you should probably disable Qt modules you don't need (like the webkit module). If you downloaded the complete sourcessource package of Qt (like https://download.qt.io/official_releases/qt/5.12/5.12.3/single/qt-everywhere-src-5.12.3.tar.xz), then you should simply delete the subdirectories of the modules you don't need before calling ./configure.

Once you've built and installed it successfully, you need to build your application using this version of Qt. If your application uses qmake, then use ~/custom_qt/5.12.23/bin/qmake to configure and build it.


Alternative to static building
Note that instead of using static linking, you can instead use normal dynamic linking but package your application as an AppImage using the linuxdeployqt tool. More info on AppImage:

https://appimage.org

You need to build Qt itself statically. Instructions:

https://doc.qt.io/qt-5/linux-building.html

To do a static build, pass the -static flag to ./configure. You might want to install this in your home directory instead of system wide. In that case, also pass something like -prefix $HOME/custom_qt/5.12.2 so that this Qt build will be installed in your home directory when you do make install.

Building is going to take a long time, so make sure to use make -jN to build it (replace N with the amount of threads/cores your CPU has.) It will still take a long time even with that, so you should probably disable Qt modules you don't need (like the webkit module). If you downloaded the complete sources of Qt, then you should simply delete the subdirectories of the modules you don't need before calling ./configure.

Once you've built and installed it successfully, you need to build your application using this version of Qt. If your application uses qmake, then use ~/custom_qt/5.12.2/bin/qmake to configure and build it.

You need to build Qt itself statically. Instructions:

https://doc.qt.io/qt-5/linux-building.html

To do a static build, pass the -static flag to ./configure. You might want to install this in your home directory instead of system wide. In that case, also pass something like -prefix $HOME/custom_qt/5.12.3 so that this Qt build will be installed in your home directory when you do make install.

Building is going to take a long time, so make sure to use make -jN to build it (replace N with the amount of threads/cores your CPU has.) It will still take a long time even with that, so you should probably disable Qt modules you don't need (like the webkit module). If you downloaded the complete source package of Qt (like https://download.qt.io/official_releases/qt/5.12/5.12.3/single/qt-everywhere-src-5.12.3.tar.xz), then you should simply delete the subdirectories of the modules you don't need before calling ./configure.

Once you've built and installed it successfully, you need to build your application using this version of Qt. If your application uses qmake, then use ~/custom_qt/5.12.3/bin/qmake to configure and build it.


Alternative to static building
Note that instead of using static linking, you can instead use normal dynamic linking but package your application as an AppImage using the linuxdeployqt tool. More info on AppImage:

https://appimage.org

Source Link
Nikos C.
  • 52.2k
  • 10
  • 77
  • 104

You need to build Qt itself statically. Instructions:

https://doc.qt.io/qt-5/linux-building.html

To do a static build, pass the -static flag to ./configure. You might want to install this in your home directory instead of system wide. In that case, also pass something like -prefix $HOME/custom_qt/5.12.2 so that this Qt build will be installed in your home directory when you do make install.

Building is going to take a long time, so make sure to use make -jN to build it (replace N with the amount of threads/cores your CPU has.) It will still take a long time even with that, so you should probably disable Qt modules you don't need (like the webkit module). If you downloaded the complete sources of Qt, then you should simply delete the subdirectories of the modules you don't need before calling ./configure.

Once you've built and installed it successfully, you need to build your application using this version of Qt. If your application uses qmake, then use ~/custom_qt/5.12.2/bin/qmake to configure and build it.