主页 > 手机  > 

linux下Qt使用LinuxDeployqt打包

linux下Qt使用LinuxDeployqt打包
linux下Qt使用LinuxDeployqt打包

环境: Ubuntu2204

一、直接使用linuxDeployqt程序打包 1.下载linuxdeployqt-continuous-x86_64.AppImage

github /probonopd/linuxdeployqt/releases

2.修改名称和权限 mv linuxDeployqt-x86_64.AppImage linuxdeployqt sudo chmod +x linuxdeployqt 3.配置QT环境变量 export PATH=/opt/qt5.12/5.12.12/gcc_64/bin:$PATH export LIB_PATH=/opt/qt5.12/5.12.12/gcc_64/lib:$LIB_PATH export PLUGIN_PATH=qt5.12/5.12.12/gcc_64/plugins:$PLUGIN_PATH export QML2_PATH=qt5.12/5.12.12/gcc_64/qml:$QML2_PATH 4. 将Qt应用拷贝到某个目录下

使用linuxDeployqt命令打包

linuxDeployqt xxx -appimage

xxx: 改为自己要打包的应用名称

输出 Error: The host system is too new. 原因

ubuntu版本太新

二、另一个方法下载linuxDeployqt源码并编译 1. 下载tar源码, 解压

github /probonopd/linuxdeployqt/releases download.csdn.net/download/LiHong333/88565443

2. 编译源码

在linuxdeployqt-continuous/tools/linuxdeployqt目录下找到main.cpp文件,修改版本判断,将下面的代码屏蔽;

//if (strverscmp (glcv, "2.32") >= 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 supported mainstream distribution (Ubuntu Focal Fossa), which is glibc 2.31."; // qInfo() << "This is so that the resulting bundle will work on most still-supported Linux distributions."; // qInfo() << "For more information, please see"; // qInfo() << " github /probonopd/linuxdeployqt/issues/340"; // return 1; //} 3. 在linuxdeployqt-continuous目录下编译 /linuxdeployqt-continuous$ qmake /linuxdeployqt-continuous$ make cd src/ && ( test -e Makefile || /opt/qt5.12/5.12.12/gcc_64/bin/qmake -o Makefile /linuxdeployqt-continuous/src/src.pro ) && make -f Makefile make[1]: Entering directory '/linuxdeployqt-continuous/src' make[1]: Nothing to be done for 'first'.
标签:

linux下Qt使用LinuxDeployqt打包由讯客互联手机栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“linux下Qt使用LinuxDeployqt打包