windeployqt错过了一些库,并获得了不需要的其他人 [英] windeployqt misses some of the libraries and gets others that are not required

查看:2536
本文介绍了windeployqt错过了一些库,并获得了不需要的其他人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

平时要deply一个Qt项目,我可以:

Usually to deply a Qt project I either:


  1. 保持运行它,发现它抱怨缺少并将它们添加到库有没有更多的。

  2. 使用的Dependency Walker,让我最的方式(如果不是全部),然后回到选项1。

  3. 或者只是建立一个静态链接的版本(疼痛的屁股有时)

所以,我现在想尝试windeployqt我存在于其中 D:\install\Qt\5.5\mingw492_32\bin\

So I now wanted to try windeployqt which for me exists in D:\install\Qt\5.5\mingw492_32\bin\

使用:

D:\> D:\install\Qt\5.5\mingw492_32\bin\windeployqt。 EXE D:\software\build-qtGuiTestApp-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug

下面是输出的结果:

D:\software\build-qtGuiTestApp-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug\qtGuiTes
tApp.exe 32 bit, debug executable
Adding Qt5Svg for qsvgicond.dll
Skipping plugin qmldbg_qtquick2d.dll due to disabled dependencies.
Skipping plugin qmldbg_tcpd.dll due to disabled dependencies.
Direct dependencies: Qt5Core Qt5Network Qt5WebKitWidgets Qt5Widgets
All dependencies   : Qt5Core Qt5Gui Qt5Multimedia Qt5MultimediaWidgets Qt5Networ
k Qt5OpenGL Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5Sensors Qt5Sql Qt5
WebKit Qt5WebKitWidgets Qt5Widgets
To be deployed     : Qt5Core Qt5Gui Qt5Multimedia Qt5MultimediaWidgets Qt5Networ
k Qt5OpenGL Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5Sensors Qt5Sql Qt5
Svg Qt5WebKit Qt5WebKitWidgets Qt5Widgets
Updating Qt5WebChanneld.dll.
Updating icuin54.dll.
Updating icuuc54.dll.
Updating icudt54.dll.
Updating Qt5Cored.dll.
Updating Qt5Guid.dll.
Updating Qt5Multimediad.dll.
Updating Qt5MultimediaWidgetsd.dll.
Updating Qt5Networkd.dll.
Updating Qt5OpenGLd.dll.
Updating Qt5Positioningd.dll.
Updating Qt5PrintSupportd.dll.
Updating Qt5Qmld.dll.
Updating Qt5Quickd.dll.
Updating Qt5Sensorsd.dll.
Updating Qt5Sqld.dll.
Updating Qt5Svgd.dll.
Updating Qt5WebKitd.dll.
Updating Qt5WebKitWidgetsd.dll.
Updating Qt5Widgetsd.dll.
Updating libGLESV2d.dll.
Updating libEGLd.dll.
Updating D3Dcompiler_47.dll.
Creating directory audio.
Updating qtaudio_windowsd.dll.
Creating directory bearer.
Updating qgenericbearerd.dll.
Updating qnativewifibearerd.dll.
Creating directory iconengines.
Updating qsvgicond.dll.
Creating directory imageformats.
Updating qddsd.dll.
Updating qgifd.dll.
Updating qicnsd.dll.
Updating qicod.dll.
Updating qjp2d.dll.
Updating qjpegd.dll.
Updating qmngd.dll.
Updating qsvgd.dll.
Updating qtgad.dll.
Updating qtiffd.dll.
Updating qwbmpd.dll.
Updating qwebpd.dll.
Creating directory mediaservice.
Updating dsengined.dll.
Updating qtmedia_audioengined.dll.
Creating directory platforms.
Updating qwindowsd.dll.
Creating directory playlistformats.
Updating qtmultimedia_m3ud.dll.
Creating directory position.
Updating qtposition_positionpolld.dll.
Creating directory printsupport.
Updating windowsprintersupportd.dll.
Creating directory sensorgestures.
Updating qtsensorgestures_plugind.dll.
Updating qtsensorgestures_shakeplugind.dll.
Creating directory sensors.
Updating qtsensors_genericd.dll.
Creating directory sqldrivers.
Updating qsqlited.dll.
Updating qsqlmysqld.dll.
Updating qsqlodbcd.dll.
Updating qsqlpsqld.dll.
Creating D:\software\build-qtGuiTestApp-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug
\translations...
Creating qt_ca.qm...
Creating qt_cs.qm...
Creating qt_de.qm...
Creating qt_fi.qm...
Creating qt_fr.qm...
Creating qt_hu.qm...
Creating qt_it.qm...
Creating qt_ja.qm...
Creating qt_ko.qm...
Creating qt_lv.qm...
Creating qt_ru.qm...
Creating qt_sk.qm...
Creating qt_uk.qm...

D:\>

看起来不错,因为我的项目虽然很简单,但使用: core ,gui,network,webkit,webkitwidgets 所以是啊,很多qt库。

So looks good, since my project, although very simple, uses: core, gui, network, webkit, webkitwidgets so yeah, a lot of qt libraries.

但是当我运行我的可执行文件时,它找不到以下libs:

However when I run my executable I get the error that it can't find the following libs:


  • libgcc_s_dw2-1.dll

  • libstdc ++ - 6 .dll

  • libwinpthread-1.dll

我手动从同一个文件夹 D:\install\Qt\5.5\mingw492_32\bin\ ),它工作正常。我的问题是:

I manually added them from the same folder (D:\install\Qt\5.5\mingw492_32\bin\) and it works fine. My questions are:


  1. 为什么会遗漏这些文件?

  2. 他们?

  3. 1GB的库似乎对我有点过分,所以我去了一些,删除了一些我认为我不需要,我的可执行文件仍然运行良好。那么,如何才能使windeployqt更有效率,只需获取所需的DLL?

没有这些问题,我发现这个工具对我来说有点无用,因为我可以做得更好自己....我可能可以脚本的东西,继续运行它,读取错误,并复制相关的dll:o

Without these questions answered, I find that this tool is a bit useless to me since I can do better myself.... I could probably script something up to keep running it and read the error and copy the relevant dll :o

编辑

以下文件夹(带有dll)添加到哪里,但它们只有75mb ...由于webkit,quick,gui和其他大Qt库我使用:

The following folders (with dll's) where added, but they only amount to 75mb... to be fair the nearly 1GB is due to webkit, quick, gui and other large Qt libs that I AM using:

mediaservice,
平台,
playlistformats,
position,
printsupport,
sensorgestures,
sensors,
sqldrivers,
translations,
audio,
iconengines,
imageformats

推荐答案



  1. 为什么会错过这些文件?


这些文件与mingw运行时库相关,不属于Qt,这就是为什么windeployqt不会默认添加它们。

these files are related to the mingw runtime library, they do not belong to Qt and that's why windeployqt does not add them by default.



  1. 我如何让它获取它们?


,以使windeployqt将它们添加到deploy目录,请尝试将 - compiler-runtime 切换到您的命令。请注意,您应该使用Qt在其开始菜单快捷方式中提供的命令提示符,而不是自己定位windeployqt路径。

in order to make windeployqt add them to the deploy directory, try adding the --compiler-runtime switch to your command. Note that you should use the command prompt that Qt provides in its start menu shortcuts instead of locating windeployqt path yourself.



  1. 1GB的libs似乎对我有点过分,所以我去了,删除了一些,我认为我不需要,我的可执行文件仍然运行良好。那么,如何才能使windeployqt更有效率,只需获取所需的DLL呢?


都取决于你的项目中太多的模块,所以包括所有他们的dll文件将不得不大,但不知道你排除的dll文件,以及你的程序运行良好没有他们。也许你可以命名一些不需要的dll文件。当然,只要你不打破许可证,你总是可以选择静态构建(这将导致更小更干净的部署大小)。

I think you are depending on too many modules in your project, so including all their dll files will have to be large, not sure however about the dll files that you exclude and how your program runs fine without them. maybe you can name some of the dll files that are not required. And of course you always have the option of static building (which will result in smaller and cleaner deployment size) as long as you don't break the license.

这篇关于windeployqt错过了一些库,并获得了不需要的其他人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆