当前位置:网站首页>Cross platform packaging of QT packaging program
Cross platform packaging of QT packaging program
2022-04-23 05:28:00 【Oriental forgetfulness】
This article is about linux Program packaging in the system , First, let's create a simple program , My program is called debtest

Then set the qmake source , This directly determines what the program depends on qt Location of the library , If we need to specify qt Location of the standard library , that qt The environment needs to be in that position .
Before the change : The location of the default library used



How to use the link library path specified by ourselves , First, you need to compile the source code yourself or directly copy the installed qt Environmental Science , as follows

Put this gcc_64 The copy of the directory should be in the location we specify .

Then configure qt


Then delete the old execution file , Build new , Then check the location of the link library of the execution file , Found that it has been changed to the location we specified .

Now get ready to pack , Before packaging, we need a program to find the relevant library linuxdeployqt, Use the method to see the tutorial linuxdeployqt course
And then use linuxdeployqt debtest --appimage after , Will generate a lib Folders and one plugins Folder , We'll use... Later ,
Now create a packaging folder

Create a... In this folder DEBIAN Folder , Create two files in this folder

control Is the information configuration file ,

postinst Is the script execution file during installation , This file can do some root Next operation .
Of course Deian There are other control files in the installation package : Such as
preinst: Debian software package (".deb") Script executed before decompression , Stop related services for the package being upgraded , Until the upgrade or installation is complete . ( Execute... After success postinst Script ).
postinst: Mainly complete the software package (".deb") Configuration work required after installation . Usually , postinst The script requires the user to enter , and / Or warn the user if they accept the default value , You should remember to go back and reconfigure the software as required . After a software package is installed or upgraded ,postinst
Script driven commands , Start or restart the corresponding service .
prerm: Stop a package related process , To uninstall the relevant files of the package, execute .
postrm: Modify relevant files or connections , and / Or uninstall the files created by the package . All current configuration files can be found in /var/lib/dpkg/info In the directory , And foo Package related names are named after “foo” start , With “preinst”, “postinst”, Equal as extension . In this directory foo.list File lists all the files installed by the software package .Debian In the use apt-get When installing or uninstalling software , Pre processing or post-processing errors often occur , At this time, just delete the corresponding script file , Re install or uninstall
Then create a folder to put the packaged files , This folder will correspond to the root path , If you name mkdir -p uer/local/bin Words , Then the program will be installed in /usr/local/bin/ below , The name here is as follows .

And then put the just lib and plugins Put all the files in , There are also executive documents and associated ( Such as icon file ), as follows

Why create qtlib, Because this corresponds to the library link location above , As shown in the figure, this library is linked in debtest/qtlib Next 
Now go back to the executable directory and start packaging 
After packing , Installation sudo dpkg -i debdir/debtest.deb

installation is complete , Then go to the installation directory to execute , This time may prompt
qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “”
This is because plugins Not loaded into . resolvent
After solving the problem, you can start the program .
版权声明
本文为[Oriental forgetfulness]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220543307094.html
边栏推荐
- Source code analysis of how to use jump table in redis
- 创建进程内存管理copy_mm - 进程与线程(九)
- 2021-09-28
- Watch depth monitoring mode
- To understand Devops, you must read these ten books!
- Edit, cancel, pull up menu
- 2021-11-08
- The main difference between pointer and reference
- Cross domain CORS relationship~
- Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
猜你喜欢

Intel SGX preliminary learning and understanding notes (continuously updated)

npm升级后问题,慌得一批

2021-11-01

Three 之 three.js (webgl)简单实现根据点绘制线/弧线(基于LineGeometry / Line2 / LineMaterial,绘制两点基于圆心的弧线段)

selenium预先加载cookie的必要性

Cross domain CORS relationship~

open3d材质设置参数分析

(11) Vscode code formatting configuration

分支与循环语句

Box collapse and margin collapse
随机推荐
Qingdao agile tour, coming!
Call the interface to get the time
Create process memory management copy_ Mm - processes and threads (IX)
Processus d'exécution du programme exécutable
Branch and loop statements
Modèle axé sur le domaine DDD (III) - gestion des transactions à l'aide de Saga
2021-10-25
The introduction of lean management needs to achieve these nine points in advance
MFC implementation resources are implemented separately by DLL
When is it appropriate for automated testing? (bottom)
The address value indicated by the pointer and the value of the object indicated by the pointer (learning notes)
Basic knowledge of redis
MFC实现资源单独Dll实现
Log introduction and building web application
弘玑|数字化时代下,HR如何进行自我变革和组织变革?
egg的static的前缀是可以修改惹,靴靴
selenium預先加載cookie的必要性
创建进程内存管理copy_mm - 进程与线程(九)
Ehcache Memcache redis three caches
Wbpack configuring production development environment