centos7.4 Qt5.9.1 打包程序

74 篇文章 4 订阅
#第一步:
#1.将程序、Qt 安装目录下的plugins/platforms文件夹、Qt安装目录下的lib目录下的libicudata.so.56.1、libicui18n.so.56.1、libicuuc.so.56.1、libQt5Core.so.5.9.1、libQt5DBus.so.5.9.1、libQt5Gui.so.5.9.1、libQt5Widgets.so.5.9.1、libQt5XcbQpa.so.5.9.1文件拷贝到同一个目录
#2.在程序当前目录执行软链接命令。

#3.将程序当前目录下的Qt依赖库包括软链接,拷贝一份到platforms文件夹。如果缺少相关dll。可执行ldd libqxcb.so

ln -s libQt5Core.so.5.9.1 libQt5Core.so.5.9
ln -s libQt5Core.so.5.9 libQt5Core.so.5
ln -s libQt5Core.so.5 libQt5Core.so

ln -s libQt5Gui.so.5.9.1 libQt5Gui.so.5.9
ln -s libQt5Gui.so.5.9 libQt5Gui.so.5
ln -s libQt5Gui.so.5 libQt5Gui.so


ln -s libQt5Widgets.so.5.9.1 libQt5Widgets.so.5.9
ln -s libQt5Widgets.so.5.9 libQt5Widgets.so.5
ln -s libQt5Widgets.so.5 libQt5Widgets.so

ln -s libicui18n.so.56.1 libicui18n.so.56
ln -s libicui18n.so.56 libicui18n.so

ln -s libicuuc.so.56.1 libicuuc.so.56
ln -s libicuuc.so.56 libicuuc.so


ln -s libicudata.so.56.1 libicudata.so.56
ln -s libicudata.so.56 libicudata.so

ln -s libQt5XcbQpa.so.5.9.1 libQt5XcbQpa.so.5.9
ln -s libQt5XcbQpa.so.5.9 libQt5XcbQpa.so.5
ln -s libQt5XcbQpa.so.5 libQt5XcbQpa.so


ln -s libQt5DBus.so.5.9.1 libQt5DBus.so.5.9
ln -s libQt5DBus.so.5.9 libQt5DBus.so.5
ln -s libQt5DBus.so.5 libQt5DBus.so
#第二步。gedit ~/.bashrc  
export QT_PLUGIN_PATH=当前程序存放目录

export LD_LIBRARY_PATH=当前程序存放目录/platforms:$LD_LIBRARY_PATH

#第三步:source ~/.bashrc
#第四步:重启电脑


#第五步:SecureCRT远程连接centos7.3最新系统,通过命令启动程序会遇到QXcbConnection: Could not connect to display。解决办法:在SecureCRT命令窗口输入:export DISPLAY=:0.0
#第六步:启动程序,执行 ./程序名 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值