【发布时间】:2017-10-13 11:51:45
【问题描述】:
我被告知“windeployqt”实用程序,它应该能够收集正确运行我的 Windows Qt 应用程序所需的所有 Qt/MinGW DLL。所以我试了一下。
不幸的是,我注意到它收集的文件比必要的多。我将 windeployqt 实用程序收集的文件与“Dependency Walker”报告的文件进行了比较。真正需要的文件已收集妥当,但出于某种原因也收集了以下文件:
Qt5Svg.dll
iconengines\qsvgicon.dll
imageformats\qdds.dll
imageformats\qgif.dll
imageformats\qicns.dll
imageformats\qico.dll
imageformats\qjp2.dll
imageformats\qjpeg.dll
imageformats\qmng.dll
imageformats\qsvg.dll
imageformats\qtga.dll
imageformats\qtiff.dll
imageformats\qwbmp.dll
imageformats\qwebp.dll
应用程序只处理 QBus 并使用 QWidgets 来显示一个简单的窗口。因此,我看不出收集这些 DLL 的原因。
【问题讨论】:
-
你是如何调用“windeployqt”的?
-
在没有安装任何开发工具的干净机器上打开应用程序并进入所有 dll 所在的文件夹。全选然后shift+delete,不被app使用的dll会被删除。
-
@Mohammed Kanan:我在 Qt/MinGW 构建环境中使用 CMake,其中 winqtdeploy 由 _add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND windeployqt --force --debug --no-translations - -dir "${CMAKE_BINARY_DIR}/dist/bin" "${PROJECT_NAME}.exe")
-
@Angel Risteski:感谢您的精彩提示。但目标是我们的自动构建系统将输出一组适当的二进制文件。
标签: windows qt deployment mingw building