首页 > 系统相关 >linuxdeployqt QT打包

linuxdeployqt QT打包

时间:2022-10-31 11:15:31浏览次数:68  
标签:CMakeLists cmake QT master linuxdeployqt txt 目录 打包

一、环境

硬件平台:英伟达Xavier

系统版本:Ubuntu 18.04.3 LTS

Qt版本:Qt5.9.5

二、步骤

1、下载linuxdeployqt源码:

下载地址:Releases · probonopd/linuxdeployqt · GitHub

2、解压linuxdeployqt.zip:

        unzip linuxdeployqt.zip

3、安装cmake与patchelf

        sudo apt-get install cmake

        sudo apt-get install patchelf

 4、进入linuxdeployqt-master目录执行:

        cmake CMakeList.txt

         出现如下错误:

  1.   nvidia@tegra-ubuntu:~/linuxdeployqt-master$ cmake CMakeLists.txt
  2.   fatal: not a git repository (or any of the parent directories): .git
  3.   CMake Error at CMakeLists.txt:35 (message):
  4.   Failed to determine git commit ID
  5.    
  6.    
  7.   -- Configuring incomplete, errors occurred!
  8.   See also "/home/nvidia/linuxdeployqt-master/CMakeFiles/CMakeOutput.log".

原因:不要在linuxdeployqt-master目录下执行cmake CMakeLists.txt ,而是进入linuxdeployqt-master/tools/linuxdeployqt/目录下执行cmake CMakeLists.txt。

5、进入 linuxdeployqt-master/tools/linuxdeployqt/目录执行:

        cmake CMakeList.txt

6、在 linuxdeployqt-master/tools/linuxdeployqt/目录执行:

        make

报错如下:

 根据报错,打开main.cpp屏蔽52-53行代码。

再次编译。,提示生成linuxdeployqt。

 

7、修改权限

        chmod 777 linuxdeployqt

8、将可执行文件放入 /usr/local/bin目录下

        mv linuxdeployqt /usr/local/bin

9、测试是否安装成功

        linuxdeployqt --version 

输出如下信息 ,表示安装成功。

 

10、在 Qt的Release目录下使用linuxdeployqt复制依赖。

        linuxdeployqt XXX -appimage

“XXX”是Qt的Release目录下的可执行文件名。

 

标签:CMakeLists,cmake,QT,master,linuxdeployqt,txt,目录,打包
From: https://www.cnblogs.com/zxdplay/p/16843606.html

相关文章