当前位置:网站首页>工作小计 QT打包
工作小计 QT打包
2022-08-03 22:23:00 【Zip-List】
工作小计 QT打包
qt的程序调试好了后,如果需要发给其他人,需要连带库等文件一起打包
需要工具linuxdeployqt,源码编译好后,加入可执行路径
版本报错就高版本运行linuxdeployqt,注释掉部分代码即可
linuxdeployqt XXX -no-strip
#-no-strip会使得文件变大,保留更多的信息
执行完毕后,发现多了qt.conf文件和lib plugins translations三个文件夹
---bin
---xxx
---qt.conf
---lib
---plugins
---translations
可以看到qt.conf把依赖文件都生成好放入了对应的文件夹中
# Generated by linuxdeployqt
# https://github.com/probonopd/linuxdeployqt/
[Paths]
Prefix = ../
Plugins = plugins
Imports = qml
Qml2Imports = qml
此时可以直接执行以下xxx文件,发现报错缺少qt的部分组件,qml没有找到。将qt对应的qml文件夹拷贝到当前目录
cp /home/test/Qt/5.15.2/gcc_64/qml ./ -r
如果仍然缺少文件,把ldd需要链接的文件全给他链接过去,执行copylib.sh xxx
#!/bin/sh
bin=$1 #发布的程序名称
desDir="../lib" #你的路径,在这里就是上一级目录里的lib
if [ ! -d $desDir ];then
#echo "makedir $desDir"
mkdir $desDir
fi
libList=$(ldd $bin | awk '{
if (match($3,"/")){
printf("%s "),$3 } }')
cp $libList $desDir
启动脚本搞一下,链接上对应的库
PWD=`pwd`
export LD_LIBRARY_PATH=${
PWD}/lib:$LD_LIBRARY_PATH
nohup ./bin/xxx&
打包
zip pkg.zip ./bin/ ./translations/ ./qml/ ./lib ./plugins/ run.sh -r
收到包后执行run.sh即可
qt相关的bashrc设置
#run qt
export QT_DIR=~/Qt/5.15.2/gcc_64/
export Qt5_DIR=~/Qt/5.15.2/gcc_64/
#qtdeploy
export QTDIR=~/Qt/5.15.2
export PATH=${QTDIR}/gcc_64/bin:~/Qt/Tools/QtCreator/bin:~/Qt/Tools/QtDesignStudio/bin:$PATH
export LD_LIBRARY_PATH=${QTDIR}/gcc_64/lib:~/Qt/Tools/QtCreator/lib/Qt/lib/:$LD_LIBRARY_PATH
export QML_IMPORT_PATH=${QTDIR}/gcc_64/qml
边栏推荐
- Cisco ike2 IPSec配置
- 『百日百题 · 基础篇』备战面试,坚持刷题 第四话——循环语句!
- Pay from 0 to 1
- 【进阶自动化测试】一文1000教你如何用Postman做接口自动化测试
- 480. Sliding Window Median
- LabVIEW代码生成错误 61056
- 关于Yii2批量更新的操作
- CAS:1260586-88-6_Biotin-C5-Azide_Biotin-C5-Azide
- On the Qixi Festival of 2022, I will offer 7 exquisite confession codes, and at the same time teach you to quickly change the source code for your own use
- LabVIEW code generation error 61056
猜你喜欢

用于流动质押和收益生成的 Web3 基础设施

2022-08-03 Oracle executes slow SQL-Q17 comparison

CAS:1797415-74-7_TAMRA-Azide-PEG-Biotin

嵌入式系统:概述

On the Qixi Festival of 2022, I will offer 7 exquisite confession codes, and at the same time teach you to quickly change the source code for your own use

noip初赛

易观分析:2022年Q2中国网络零售B2C市场交易规模达23444.7亿元

【day6】类与对象、封装、构造方法

encapsulation, package, access modifier, static variable

『百日百题 · 基础篇』备战面试,坚持刷题 第四话——循环语句!
随机推荐
Flutter 桌面探索 | 自定义可拖拽导航栏
HCIP第十四天
Network basic learning series four (network layer, data link layer and some other important protocols or technologies)
【进阶自动化测试】一文1000教你如何用Postman做接口自动化测试
override学习(父类和子类)
Data_web(八)mysql增量同步到mongodb
如何设计 DAO 的 PoW 评判标准 并平衡不可能三角
静态文件快速建站
斩获双奖|易知微荣获“2021中国数字孪生解决方案优秀供应商”“中国智能制造优秀推荐产品”双奖项!
深度学习和机器学习有什么区别?
从0到1看支付
start with connect by implements recursive query
剑指offer第22题-链表中倒数第K个节点
2022的七夕,奉上7个精美的表白代码,同时教大家快速改源码自用
CAS:122567-66-2_DSPE-Biotin_DSPE-Biotin
CAS:1620523-64-9_Azide-SS-biotin_biotin-disulfide-azide
全球观之地理部分
CAS:1260586-88-6_Biotin-C5-Azide_Biotin-C5-Azide
480. Sliding Window Median
目标检测技术研究现状及发展趋势