The general process of packaging Qt programs under Linux

compile

Manually write compilation scripts

qmake
make

Copy dependent libraries

Reference article:

https://blog.csdn.net/JOBbaba/article/details/124289626
https://zhuanlan.zhihu.com/p/49919048

  1. Copy system dependent libraries

Write a replication scriptcopy.sh

ldd
  1. Copy Qt dependent libraries

Mainly, the related dependencies of libqxcb.so need to be copied. Please note that you must specify before executing the cpoy.sh script.

export LD_LIBRARY_PATH=/opt/Qt/5.15.2/gcc_64/lib

Otherwise, the dependencies of libqxcb.so are looked up from the system library by default.

  1. Copy qml related files

Because QtQuick is used in the program, Quick related files need to be copied to the directory.

Mainly 5 folders:

  • /opt/Qt/5.15.2/gcc_64/qml/Qt
  • /opt/Qt/5.15.2/gcc_64/qml/QtGraphicalEffects
  • /opt/Qt/5.15.2/gcc_64/qml/QtQml
  • /opt/Qt/5.15.2/gcc_64/qml/QtQuick
  • /opt/Qt/5.15.2/gcc_64/qml/QtQuick.2
  1. Write startup script to specifyLD_LIBRARY_PATH
export LD_LIBRARY_PATH=当前目录
  1. Troubleshoot the problem. Some libraries may still not be found. Note that there may beshortcut libraries.
find /opt -name 库名

cp -r 目录 ./
  1. ldd confirms and the script is executed
./start.sh

dpkg package

https://blog.csdn.net/weixin_39083202/article/details/106817151

Guess you like

Origin blog.csdn.net/Star_ID/article/details/134827686