当前位置:网站首页>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
边栏推荐
- What are the most popular recruitment technical skills in 2022? You can't think of it
- Error handling mechanism of the strongest egg framework in history
- Laravel database
- 世界与个人发展
- Laravel [view]
- selenium預先加載cookie的必要性
- Self incrementing sequence creation of MySQL
- Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
- 狼叔来找翻译人员了--plato--持续翻译中.....
- JS array common methods
猜你喜欢
C#测试调用PaddleSharp模块识别图片文字
uni使用的一些坑
領域驅動模型DDD(三)——使用Saga管理事務
Kanban Quick Start Guide
创建进程内存管理copy_mm - 进程与线程(九)
[triangle Yang Hui triangle printing odd even cycle JS for break cycle]
2021-10-25
Requirements for SQL server to retrieve SQL and user information
2021-09-27
Source code analysis of how to use jump table in redis
随机推荐
2021-10-25
What are the most popular recruitment technical skills in 2022? You can't think of it
Intel SGX preliminary learning and understanding notes (continuously updated)
Log introduction and building web application
使用宝塔+xdebug+vscode远程调试代码
How to add beautiful code blocks in word | a very complete method to sort out and compare
Double click The jar package cannot run the solution
[no title] Click the classification jump page to display the details
egg中的多进程模型--egg文档搬运工
如果我是pm之 演出电影vr购票展示
Simple and basic use of switch and if
修仙真实世界与游戏世界
Anti crawler (0): are you still climbing naked with selenium? You're being watched! Crack webdriver anti crawler
Kanban Quick Start Guide
Escape characters \ splicing of data formats
Uniapp hot update with progress bar
巴普洛夫与兴趣爱好
Output string in reverse order
The introduction of lean management needs to achieve these nine points in advance
Laravel routing job