要检查在 Windows 上部署应用程序所需的 DLL,请使用依赖项 Walker ( http://www.dependencywalker.com/ )。
根据文档页面Qt for Windows - Deployment一些 DLL 需要在 Windows 平台上部署 Qt 应用程序:
- qwindows.dll
- icudtXX.dll
- icuinXX.dll
- icuucXX.dll
- libGLESv2.dll
- libEGL.dll
根据您用于编译应用程序的编译器,可能需要一些其他库:
- MSVC 特定库:
- MinGW 特定库
- libgcc_s_dw2-1.DLL
- libstdc++-6.dll
注意:在所有这些文件中,将 XX 替换为系统上当前版本的 DLL。
如果您没有静态构建 Qt(默认),您还需要 Qt5 DLL,具体取决于您在应用程序中使用的 Qt 模块。例子:
- Qt5Core.dll
- Qt5Test.dll
- Qt5Network.dll
- 等等
所有这些 DLL 都可以在 Qt 安装目录下的“bin”文件夹中找到。
编辑
最近,Qt 开发人员创建了一个名为 windeployqt.exe 的工具,它可以帮助您收集部署应用程序所需的所有库:
Usage: windeployqt [options] [file]
Qt Deploy Tool 5.3.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, ANGLE, 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 this help.
-v, --version Displays version information.
--dir <directory> Use directory instead of binary directory.
--libdir <path> Copy libraries to path.
--debug Assume debug binaries.
--release Assume release binaries.
--force Force updating files.
--dry-run Simulation mode. Behave normally, but do not
copy/update any files.
--no-plugins Skip plugin deployment.
--no-libraries Skip library deployment.
--qmldir <directory> Scan for QML-imports starting from directory.
--no-quick-import Skip deployment of Qt Quick imports.
--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-compiler-runtime Do not deploy compiler runtime (Desktop only).
--webkit2 Deployment of WebKit2 (web process).
--no-webkit2 Skip deployment of WebKit2.
--json Print to stdout in JSON format.
--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.
Qt libraries can be added by passing their name (-xml) or removed by passing
the name prepended by --no- (--no-xml). Available libraries:
bluetooth clucene concurrent core declarative designercomponents designer gui
clucene qthelp multimedia multimediawidgets multimediaquick network nfc opengl
positioning printsupport qml quick quickparticles script scripttools sensors
serialport sql svg test widgets winextras xml xmlpatterns
Arguments:
[file] Binary or directory containing the binary.