我被告知“windeployqt”实用程序,它应该能够收集正确运行我的Windows Qt应用程序所需的所有Qt/MinGW DLL。所以我试了一下。为什么windeployqt输出不需要的文件,我该如何摆脱它们?
不幸的是我注意到它收集更多的文件,然后需要。我将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的文件夹。选择所有,然后转到+删除,未被应用程序使用的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“) –