当前位置:网站首页>工作小计 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
边栏推荐
- 七夕快乐!
- 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
- [N1CTF 2018] eating_cms
- Nine ways to teach you to read the file path in the resources directory
- 【刷题篇】二叉树的右视图
- pikachu Over permission
- 趣链的产品构架
- L2-041 插松枝
- E-commerce data warehouse ODS layer-----log data loading
- DO280管理和监控OpenShift平台--资源限制
猜你喜欢

【进阶自动化测试】一文1000教你如何用Postman做接口自动化测试

113. Teach a Man how to fish - How to query the documentation and technical implementation details of any SAP UI5 control property by yourself

七夕快乐!

如何设计 DAO 的 PoW 评判标准 并平衡不可能三角

CAS:122567-66-2_DSPE-Biotin_DSPE-Biotin
![[N1CTF 2018]eating_cms](/img/09/3599d889d9007eb45c6eab3043f0c4.png)
[N1CTF 2018]eating_cms

noip preliminary round

Network basic learning series four (network layer, data link layer and some other important protocols or technologies)

【MySQL进阶】数据库与表的创建和管理

E-commerce data warehouse ODS layer-----log data loading
随机推荐
嵌入式系统:概述
【云原生实用技巧】使用 skopeo 批量同步 helm chart 依赖镜像
HCIP BGP实验报告
Go开发工具GoLand V2022.2 来了——Go 工作区重大升级
DO280管理和监控OpenShift平台--资源限制
HCIP第十四天
CAS:153162-70-0_N-BOC-6-Biotinamidohexylamine
PowerMockup 4.3.4::::Crack
Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo
UVa 1025 - A Spy in the Metro(白书)
Codeup brushing notes - simple simulation
LabVIEW代码生成错误 61056
win10系统下yolov5-V6.1版本的tensorrt部署细节教程及bug修改
中国企业构建边缘计算解决方案的最佳实践
『百日百题 · 基础篇』备战面试,坚持刷题 第四话——循环语句!
HCIP第十三天
云平台建设解决方案
CAS: 1192802-98-4 _uv cracking of biotin - PEG2 - azide
如何基于WPF写一款数据库文档管理工具(二)
encapsulation, package, access modifier, static variable