当前位置:网站首页>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
边栏推荐
- How to set the initial value of El input number to null
- Intel SGX preliminary learning and understanding notes (continuously updated)
- 跨域CORS的情缘~
- [untitled] Notepad content writing area
- Laravel [view]
- Error handling mechanism of the strongest egg framework in history
- Use of uniapp native plug-ins
- Phlli in a VM node
- MFC实现资源单独Dll实现
- The main difference between pointer and reference
猜你喜欢

Use of ES6 array

領域驅動模型DDD(三)——使用Saga管理事務

如果我是pm之 演出电影vr购票展示

selenium預先加載cookie的必要性

2021-10-08

Project manager's thinking mode worth trying: project success equation

Three of three JS (webgl) simple sorting of rotation attribute function, and a simple case of rotating around the axis based on this
![[untitled]](/img/49/770888f4f351f42af0e01c3a15ddfa.png)
[untitled]

2021-10-25

MFC implementation resources are implemented separately by DLL
随机推荐
2021-09-28
Output string in reverse order
2021-10-08
Open source rule engine - Ice: dedicated to solving flexible and complex hard coding problems
弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器
Add two pointers? (legal or illegal)
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
CPT 104_TTL 09
Click the Add button - a box appears (similar to adding learning experience - undergraduate - Graduate)
弘玑Cyclone RPA为国金证券提供技术支撑,超200个业务场景实现流程自动化
创建进程内存管理copy_mm - 进程与线程(九)
Solve the problem of JS calculation accuracy
Use of ES6 array
Interpretation of common SQL statements
世界与个人发展
Vscode settings JSON configuration
String class understanding - final is immutable
C test calls the paddlesharp module to recognize pictures and words
Three 之 three.js (webgl)模型的删除/场景的清空/内存的释放 的简单整理
2021-10-12