centos7.4 Qt5.9.1 打包程序

前端之家收集整理的这篇文章主要介绍了centos7.4 Qt5.9.1 打包程序前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#第一步:
#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#第六步:启动程序,执行 ./程序名

原文链接:https://www.f2er.com/centos/374590.html

猜你在找的CentOS相关文章