当前位置:网站首页>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
边栏推荐
- Good test data management, in the end how to do?
- what is wifi6?
- Kanban Quick Start Guide
- When is it appropriate for automated testing? (bottom)
- Log introduction and building web application
- Devops life cycle, all you want to know is here!
- [untitled]
- Low code and no code considerations
- The title bar will be pushed to coincide with the status bar
- (十一)vscode代码格式化配置
猜你喜欢

Fast application fuzzy search

Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."

Understand the relationship between promise async await

Three of three JS (webgl) simple sorting of rotation attribute function, and a simple case of rotating around the axis based on this

创建进程内存管理copy_mm - 进程与线程(九)

Uniapp wechat sharing

Three methods of list rendering

双击.jar包无法运行解决方法

what is wifi6?

What are the reasons for the failure of digital transformation?
随机推荐
Three of three JS (webgl) is simple to draw lines / arcs according to points (based on linegeometry / line2 / linematerial, draw two arc segments based on the center of the circle)
What are the reasons for the failure of digital transformation?
Box collapse and margin collapse
es6数组的使用
egg的static的前缀是可以修改惹,靴靴
Cross domain CORS relationship~
可执行程序执行流程
node中的redis使用--ioredis
Intel SGX preliminary learning and understanding notes (continuously updated)
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
Necessity of selenium preloading cookies
How to realize adaptive layout
JVM memory and memory overflow exceptions (personal summary)
Branch and loop statements
Multi process model in egg -- egg document Porter
Fast application fuzzy search
2021-11-01
Top 25 Devops tools in 2021 (Part 2)
What are the most popular recruitment technical skills in 2022? You can't think of it
Log introduction and building web application