Qt windeployqt 打包的Qt动态库介绍

news2024/7/7 17:45:53

前言

在 Windows 平台,通常使用 Qt 的工具 windeployqt 将可执行文件的相关 Qt 依赖项部署到当前路径下。

Windows windeployqt 部署工具

Windows 部署工具 windeployqt 旨在自动化创建一个可部署文件夹的过程,该文件夹包含运行应用程序所需的 Qt 相关依赖项(库、QML 导入、插件和翻译)。它为 Windows 桌面应用程序创建了一个安装树,可以轻松地捆绑到安装包中。

该工具可以在 QTDIR/bin/windeployqt 中找到。为了正确运行,它需要在构建环境中运行。当使用 Qt 在线安装器时,应使用脚本 QTDIR/bin/qtenv2.bat 来设置它。

对于 Windows 桌面应用程序,默认情况下,编译器所需的运行时文件也会复制到部署文件夹中(除非指定了 --no-compiler-runtime 选项)。在 Microsoft Visual C++使用的发布版本中,这些包括 Visual C++可再发行包,这些包旨在由应用程序的安装程序在目标机器上递归安装。否则,将使用编译器运行时的共享库。

windeployqt 工具帮助说明:

Usage: windeployqt [options] [files]
Qt Deploy Tool 6.0.0

The simplest way to use windeployqt is to add the bin directory of your Qt
installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:
  windeployqt <path-to-app-binary>
If ICU, etc. are not in the bin directory, they need to be in the PATH
variable. If your application uses Qt Quick, run:
  windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>

Options:
  -?, -h, --help              Displays help on commandline options.
  --help-all                  Displays help including Qt specific options.
  -v, --version               Displays version information.
  --dir <directory>           Use directory instead of binary directory.
  --qmake <path>              Use specified qmake instead of qmake from PATH.
  --libdir <path>             Copy libraries to path.
  --plugindir <path>          Copy plugins to path.
  --debug                     Assume debug binaries.
  --release                   Assume release binaries.
  --pdb                       Deploy .pdb files (MSVC).
  --force                     Force updating files.
  --dry-run                   Simulation mode. Behave normally, but do not
                              copy/update any files.
  --no-patchqt                Do not patch the Qt6Core library.
  --ignore-library-errors     Ignore errors when libraries cannot be found.
  --no-plugins                Skip plugin deployment.
  --no-libraries              Skip library deployment.
  --qmldir <directory>        Scan for QML-imports starting from directory.
  --qmlimport <directory>     Add the given path to the QML module search
                              locations.
  --no-quick-import           Skip deployment of Qt Quick imports.
  --translations <languages>  A comma-separated list of languages to deploy
                              (de,fi).
  --no-translations           Skip deployment of translations.
  --no-system-d3d-compiler    Skip deployment of the system D3D compiler.
  --compiler-runtime          Deploy compiler runtime (Desktop only).
  --no-virtualkeyboard        Disable deployment of the Virtual Keyboard.
  --no-compiler-runtime       Do not deploy compiler runtime (Desktop only).
  --json                      Print to stdout in JSON format.
  --no-opengl-sw              Do not deploy the software rasterizer library.
  --list <option>             Print only the names of the files copied.
                              Available options:
                               source:   absolute path of the source files
                               target:   absolute path of the target files
                               relative: paths of the target files, relative
                                         to the target directory
                               mapping:  outputs the source and the relative
                                         target, suitable for use within an
                                         Appx mapping file
  --verbose <level>           Verbose level (0-2).

Qt libraries can be added by passing their name (-xml) or removed by passing
the name prepended by --no- (--no-xml). Available libraries:
bluetooth concurrent core declarative designer designercomponents gui qthelp
multimedia multimediawidgets multimediaquick network nfc opengl openglwidgets
positioning printsupport qml qmltooling quick quickparticles quickwidgets script
scripttools sensors serialport sql svg svgwidgets test websockets widgets xml
webenginecore webengine webenginewidgets 3dcore 3drenderer 3dquick
3dquickrenderer 3dinput 3danimation 3dextras geoservices webchannel serialbus
webview

Arguments:
  [files]                     Binaries or directory containing the binary.

例如使用 windeployqt 工具后, Qt 6.7.0 的动态库依赖如下:

.
├── Qt6Cored.dll
├── Qt6Guid.dll
├── Qt6Networkd.dll
├── Qt6Svgd.dll
├── Qt6Widgetsd.dll
├── QtProjectTemplate.exe
├── concrt140d.dll
├── d3dcompiler_47.dll
├── dxcompiler.dll
├── dxil.dll
├── generic
│   └── qtuiotouchplugind.dll
├── iconengines
│   └── qsvgicond.dll
├── imageformats
│   ├── qgifd.dll
│   ├── qicod.dll
│   ├── qjpegd.dll
│   └── qsvgd.dll
├── msvcp140_1d.dll
├── msvcp140_2d.dll
├── msvcp140d.dll
├── msvcp140d_atomic_wait.dll
├── msvcp140d_codecvt_ids.dll
├── networkinformation
│   └── qnetworklistmanagerd.dll
├── opengl32sw.dll
├── platforms
│   └── qwindowsd.dll
├── styles
│   └── qmodernwindowsstyled.dll
├── tls
│   ├── qcertonlybackendd.dll
│   ├── qopensslbackendd.dll
│   └── qschannelbackendd.dll
├── translations
│   ├── qt_ar.qm
│   ├── ...
│   ├── qt_zh_CN.qm
│   └── qt_zh_TW.qm
├── vccorlib140d.dll
├── vcruntime140_1d.dll
├── vcruntime140_threadsd.dll
└── vcruntime140d.dll

Qt 5.15.2 动态库依赖如下:

.
├── D3Dcompiler_47.dll
├── QtProjectTemplate.exe
├── Qt5Cored.dll
├── Qt5Guid.dll
├── Qt5Svgd.dll
├── Qt5Widgetsd.dll
├── iconengines
│   └── qsvgicond.dll
├── imageformats
│   ├── qgifd.dll
│   ├── qicnsd.dll
│   ├── qicod.dll
│   ├── qjpegd.dll
│   ├── qsvgd.dll
│   ├── qtgad.dll
│   ├── qtiffd.dll
│   ├── qwbmpd.dll
│   └── qwebpd.dll
├── libEGLd.dll
├── libGLESv2d.dll
├── opengl32sw.dll
├── platforms
│   └── qwindowsd.dll
├── styles
│   └── qwindowsvistastyled.dll
└── translations
    ├── qt_ar.qm
    ├── ...
    └── qt_zh_TW.qm

依赖动态库介绍

分发运行 Qt 应用程序所需的所有 Qt DLL 和应用程序特定插件的存档必须包括以下文件:

组件文件名
可执行文件qt-demo.exe
Qt Windows 平台插件platforms\qwindows.dll
Qt Windows Vista 风格的插件styles\qwindowsvistastyle.dll
Qt 核心模块Qt6Core.dll
Qt GUI 模块Qt6Gui.dll
Qt Widgets 模块Qt6Widgets.dll

根据应用程序使用的功能,可能需要其他插件 (iconengines, imageformats)。

iconengines:

  • qsvgicon.dll:SVG 图标支持

imageformats

  • qgif.dll:提供对 GIF 图像格式的支持。
  • qicns.dll:提供对 ICNS 图像格式的支持。
  • qico.dll:提供对 ICO 图像格式的支持。
  • qjpeg.dll:提供对 JPEG 图像格式的支持。
  • qsvg.dll:提供对 SVG 图像格式的支持。
  • qtga.dll:提供对 TGA 图像格式的支持。
  • qtiff.dll:提供对 TIFF 图像格式的支持。
  • qwbmp.dll:提供对 WBMP 图像格式的支持。
  • qwebp.dll:提供对 WebP 图像格式的支持。

注意:以上imageformats列举的动态库为 Qt 5,在 Qt 6 中有所变化,缩减了一些动态库。

此外,如果采用的是 MSVC 编译器,存档必须包含以下编译器特定的库(假设为 Visual Studio 2019):

组件文件名
C 运行时vcruntime140.dll
C++ 运行时msvcp160.dll

如果使用了动态 OpenGL,则档案可能还包含:

组件文件名
OpenGL 软件渲染库opengl32sw. dll

而在Qt 5中,如果使用动态 OpenGL,还需要包含 ANGLE 和软件渲染所需的库:

组件文件名
OpenGL 软件渲染库opengl32sw. dll
ANGLE 库libEGL.dll, libGLESv2.dll
ANGLE 的 HLSL 编译器库d3dcompiler_XX.dll

如果 Qt 配置为使用 ICU,则归档文件必须包含:

ICU 组件文件名
icudtXX. dll
icuinXX. dll
icuucXX. dll

与非系统库的直接依赖关系:

QtVisual Studio 16 (2019)MinGW
Qt6Core.dll
Qt6Gui.dll
Qt6Widgets.dll
vccorlib140.dll
vcruntime140d.dll
msvcp140.dll
libwinpthread-1.dll
libgcc_s_seh-1.dll
libstdc+±6.dll

Qt 6 中增加了传输层安全性(TLS)相关的插件,即tls目录:

  • qcertonlybackend.dll:提供了一个仅用于证书处理的后端实现。它可以用于验证证书链、检查证书的有效性和处理证书相关的任务,而不实际执行加密通信。这个后端可能在不需要完整 TLS 功能的环境中使用,比如在某些测试或调试场景中。
  • qopensslbackend.dll:基于 OpenSSL 的 TLS 后端实现。OpenSSL 是一个广泛使用的开源库,提供了丰富的加密功能和协议支持,包括 SSL 和 TLS。通过使用这个后端,Qt 应用程序可以利用 OpenSSL 的功能来实现安全的网络通信。
  • qschannelbackend.dll:提供了基于 Windows 的 SChannel(Secure Channel)安全协议的 TLS 后端实现。SChannel 是 Windows 操作系统的一部分,提供了 SSL 和 TLS 协议的支持。使用这个后端,Qt 应用程序可以在 Windows 平台上利用系统自带的安全功能来实现加密通信。

Qt 插件

所有 Qt GUI 应用程序都需要一个实现 Qt 平台抽象(QPA)层的插件。对于 Windows,平台插件的名称是 qwindows.dll。此文件必须位于您的分发目录下的特定子目录(默认为 platforms)中。或者,可以调整 Qt 用于查找其插件的搜索路径。

应用程序还可能依赖于一个或多个 Qt 插件,例如打印支持插件、JPEG 图像格式插件或 SQL 驱动程序插件。确保与您的应用程序一起分发所需的任何 Qt 插件。与平台插件类似,每种类型的插件都必须位于分发目录内特定的子目录(例如 printsupport、imageformats 或 sqldrivers)中。

总结

Qt 6 的依赖库相比 Qt5 多了很多新东西,但大多可望文生义,可猜个大概意思。也可查询官方文档进行佐证。

Qt for Windows - Deployment | Qt 6.7

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1894457.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【高校科研前沿】南京地理与湖泊研究所博士后夏凡为第一作者在环境科学与水资源领域Top期刊发文:钙对云南洱海溶解有机质与浮游细菌相互作用的调控作用

文章简介 论文名称&#xff1a;Calcium regulates the interactions between dissolved organic matter and planktonic bacteria in Erhai Lake, Yunnan Province, China 第一作者及单位&#xff1a;夏凡&#xff08;博士后|中国科学院南京地理与湖泊研究所&#xff09; 通讯…

关于虚拟机CentOS 7使用ssh无法连接(详细)

虚拟机CentOS 7使用ssh无法连接 猜测&#xff1a;可能是虚拟机软件的网关和和centos7的网关不同导致的问题。 首先打开CentOS7的终端, 输入ifconfig&#xff0c;查看一下系统的ip 打开虚拟机的虚拟网络编辑器, 查看一下网关, 发现确实不一样. 这里有两种方式, 要么修改虚…

fluwx插件实现微信支付

Flutter开发使用fluwx插件实现微信支付&#xff0c;代码量不多&#xff0c;复杂的是安卓和iOS的各种配置。 在 pubspec.yaml 文件中添加fluwx依赖 fluwx: ^4.5.5 使用方法 通过fluwx注册微信Api await Fluwx().registerApi(appId: wxea7a1c53d9e5849d, universalLink: htt…

Android系统集成和使用FFmpeg

文章目录 前言FFmpeg源码下载交叉编译NDK下载x264编译源码下载编译 FFmpeg编译脚本 AOSP继承FFmpeg 前言 原生AOSP中并未继承FFmpeg&#xff0c;所以要想在android上使用&#xff0c;需要自己编译集成。 FFmpeg源码下载 git clone https://git.ffmpeg.org/ffmpeg.git目前最新…

Java [ 基础 ] Stream流 ✨

✨探索Java基础Stream流✨ 在现代Java编程中&#xff0c;Stream是一个非常强大的工具&#xff0c;它提供了一种更高效和简洁的方式来处理集合数据。在这篇博客中&#xff0c;我们将深入探讨Java中的Stream流&#xff0c;介绍它的基础知识、常见操作和一些实用示例。 什么是Str…

暗潮短视频:成都柏煜文化传媒有限公司

暗潮短视频&#xff1a;涌动的新媒体力量 在数字化时代的浪潮中&#xff0c;短视频以其独特的魅力和无限的潜力&#xff0c;迅速成为新媒体领域的一股强大力量。而在这片繁荣的短视频领域中&#xff0c;成都柏煜文化传媒有限公司“暗潮短视频”以其独特的定位和深邃的内容&…

解决mysql数据库连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded

解决mysql数据库连接报错&#xff1a;Authentication plugin ‘caching_sha2_password’ cannot be loaded OperationalError: (2059, “Authentication plugin ‘caching_sha2_password’ cannot be loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open sha…

虚拟机与主机的联通

本地光纤分配地址给路由器--》连结路由器是连结局域网--》由路由器分配IP地址 因此在网站上搜索的IP与本机的IP是不一样的 1.windows查看主机IP地址 在终端输入 2.linux虚拟机查看ip 3.主机是否联通虚拟机ping加ip

【AI学习】无线AI的问题和挑战

无线AI&#xff0c;即无线人工智能&#xff0c;是指内生于未来&#xff08;6G&#xff09;无线通信系统并通过无线架构、无线数据、无线算法和无线应用所呈现出来的新的人工智能技术体系。 最近一直在进行无线AI的调研&#xff0c;感觉真的是路漫漫其修远兮。业界有一些探索&a…

数学建模------Matlab数据可视化

目录 1.plot函数 &#xff08;1&#xff09;函数介绍 &#xff08;2&#xff09;参数介绍 &#xff08;3&#xff09;图形美化 &#xff08;4&#xff09;背景更改 &#xff08;5&#xff09;多组绘制 &#xff08;6&#xff09;图形叠加 &#xff08;7&#xff09;添加…

Matplotlib 简介

import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel(some numbers) plt.show() 当使用plot只传入单个数组时&#xff0c;matplotlib会认为这是y的值&#xff0c;并自动生成长度相同&#xff0c;但是从0开始的x值&#xff0c;所以这里的x会自动生成为 [0,1,2,…

Vue.js 案例——商品管理

一.需要做出的效果图&#xff1a; 二.实现的步骤 首先&#xff0c;先建一个项目&#xff0c;命名Table&#xff0c;在Table项目中的components里新建一个MyTable.vue文件。 第二步&#xff0c;在原有的 HelloWorld.vue中写入代码。 HelloWorld.vue代码如下&#xff1a; <…

土地规划与文化遗产保护:在发展浪潮中守护历史的脉络

在这个日新月异的时代&#xff0c;城市化进程如火如荼&#xff0c;土地规划作为引导城市发展方向的关键&#xff0c;承载着平衡发展与保护的重任。在追求现代化的同时&#xff0c;保护文化遗产不仅是对过去的尊重&#xff0c;更是对未来负责。本文旨在深入探讨如何在土地规划实…

云桌面运维工程师

一 深信服驻场工程师 1 深信服AC、AF、AD、NGAF、WOC Atrust、WAF项目实施经验者优先考虑。 负责云桌面POC测试 部署和配置&#xff1a;设置云桌面基础设施&#xff0c;包括虚拟化平台、云桌面管理软件和相关组件。确保正确配置网络、存储和安全设置。 用户体验&#xff1…

7.3数据库第一次作业

安装MySQL 1.打开安装包 2.选择自定义安装&#xff08;custom&#xff09;并点击下一步 3.自定义安装路径 4.点击执行 5.执行成功 6.默认选项点击下一步 7.选择新的授权方式并点击下一步 8.配置密码 9.默认配置并点击下一步 10.点击执行&#xff08;Execute&#xff09; 11.执…

bcc python开发示例

文章目录 1. hello_world.py2. hello_fields.py3. sync_timing.py4. disksnoop.py5. hello_perf_output.py6. bitehist.py7. vfsreadlat.py8. urandomread.py9. strlen_count.py10. nodejs_http_server.py11. task_switch.c12. 监视 do_execve 1. hello_world.py from bcc imp…

Ubuntu 24.04-自动安装-Nvidia驱动

教程 但在安全启动模式下可能会报错。 先在Nvidia官网找到GPU对应的驱动版&#xff0c; 1. 在软件与更新中选择合适的驱动 2. ubuntu自动安装驱动 sudo ubuntu-drivers autoinstall显示驱动 ubuntu-drivers devices3. 安装你想要的驱动 sudo apt install nvidia-driver-ve…

React@16.x(48)路由v5.x(13)源码(5)- 实现 Switch

目录 1&#xff0c;原生 Switch 的渲染内容2&#xff0c;实现 1&#xff0c;原生 Switch 的渲染内容 对如下代码来说&#xff1a; import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; function News() {return <div className"p…

Qt界面中的子窗口实现鼠标拖动边缘改变大小以及移动(完整demo代码)

目录 效果 拖拽 移动​编辑 实现 DragResizeWgt类.h文件 DragResizeWgt类.cpp文件 使用 testwidget窗口.ui文件 testwidget窗口.h文件 testwidget窗口.cpp文件 参考 效果 想要的效果就是类似于QT IDE中的效果&#xff0c;可以拖动边缘改变大小&#xff0c;用户自身可…

传承与创新,想让认字更简单?就来看《米小圈动画汉字》吧!

汉字&#xff0c;作为中华文化的精髓和根基&#xff0c;自古以来便承载着中华民族的思想与记忆。在现代社会&#xff0c;随着文化多样性的崛起和科技进步的推动&#xff0c;汉字的教育也更加的多元化&#xff0c;《米小圈动画汉字》作为一项全新的教育资源&#xff0c;不仅致力…