Qt打包 linuxdeployqt配置【无标题】

Ubuntu 编译 linuxdeployqt

博客 https://www.cnblogs.com/linuxAndMcu/p/11016322.html

安装依赖
sudo apt-get install git g++ libgl1-mesa-dev

配置Qt环境变量

没有安装vim 执行 sudo apt install vim 安装
vim ~/.bashrc中加入:
export PATH=/opt/Qt5.9.0/5.9/gcc_64/bin:$PATH
export LD_LIBRARY_PATH=/opt/Qt5.9.0/5.9/gcc_64/lib:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=/opt/Qt5.9.0/5.9/gcc_64/plugins:$QT_PLUGIN_PATH
export QML2_IMPORT_PATH=/opt/Qt5.9.0/5.9/gcc_64/qml:$QML2_IMPORT_PATH

source ~/.bashrc 立即执行

编译
git clone https://github.com/probonopd/linuxdeployqt.git
cd linuxdeployqt
vim tools/linuxdeployqt/main.cpp

修改main.cpp代码 大概在200行的位置
// openSUSE Leap 15.0 uses glibc 2.26 and is used on OBS
/if (strverscmp (glcv, “2.27”) >= 0) { //注释版本检查
qInfo() << “ERROR: The host system is too new.”;
qInfo() << “Please run on a system with a glibc version no newer than what comes with the oldest”;
qInfo() << “currently still-supported mainstream distribution (xenial), which is glibc 2.23.”;
qInfo() << “This is so that the resulting bundle will work on most still-supported Linux distributions.”;
qInfo() << “For more information, please see”;
qInfo() << “https://github.com/probonopd/linuxdeployqt/issues/340”;
return 1;
}
/

执行

qmake
make -j
sudo make install
cd bin
sudo chmod a+x linuxdeployqt
sudo cp linuxdeployqt /usr/local/bin

编译 patchelf
git clone https://github.com/NixOS/patchelf.git
cd patchelf
./bootstrap.sh
./configure
make -j
make check
sudo make install

如果出现
autoreconf: not found
安装
sudo apt-get install autoconf automake libtool
sudo apt-get install libffi-dev

下载 AppImageKit
访问 https://github.com/AppImage/AppImageKit/releases
并下载,然后运行
cp appimagetool
sudo chmod a+x appimagetool
sudo mv appimagetool /usr/local/bin

打包应用程序
linuxdeployqt -appimage

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值