PDA

View Full Version : Windows requires DLL not listed by windeployqt



gaetan_tl
20th November 2020, 16:59
Hello guys, I have my GUI for scanning purposes that works perfectly fine in QT Creator.
I use Qt 5.12.4 and mingw73_64 as compiler.
It is now times to create the installer with Inno Setup Compiler.

In order to know which DLL to include in my installer I run this command:

E:\BMS\Qt\5.12.4\mingw73_64\bin>windeployqt.exe --no-translations --list mapping D:\Svn\Scanner\build-******Scan-Qt_5_12_4_mingw73_64-Release\release

I get this output:

"E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Core.dll" "Qt5Core.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Gui.dll" "Qt5Gui.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Multimedia.dll" "Qt5Multimedia.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Network.dll" "Qt5Network.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Svg.dll" "Qt5Svg.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Widgets.dll" "Qt5Widgets.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\libGLESV2.dll" "libGLESV2.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\libEGL.dll" "libEGL.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\D3Dcompiler_47.dll" "D3Dcompiler_47.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\bin\opengl32sw.dll" "opengl32sw.dll"
"E:\BMS\Qt\Tools\mingw530_32\bin\libgcc_s_dw2-1.dll" "libgcc_s_dw2-1.dll"
"E:\BMS\Qt\Tools\mingw530_32\bin\libstdc++-6.dll" "libstdc++-6.dll"
"E:\BMS\Qt\Tools\mingw530_32\bin\libwinpthread-1.dll" "libwinpthread-1.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\audio\qtaudio_ windows.dll" "audio\qtaudio_windows.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\bearer\qgeneri cbearer.dll" "bearer\qgenericbearer.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\iconengines\qs vgicon.dll" "iconengines\qsvgicon.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q gif.dll" "imageformats\qgif.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q icns.dll" "imageformats\qicns.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q ico.dll" "imageformats\qico.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q jpeg.dll" "imageformats\qjpeg.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q svg.dll" "imageformats\qsvg.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q tga.dll" "imageformats\qtga.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q tiff.dll" "imageformats\qtiff.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q wbmp.dll" "imageformats\qwbmp.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q webp.dll" "imageformats\qwebp.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\mediaservice\d sengine.dll" "mediaservice\dsengine.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\mediaservice\q tmedia_audioengine.dll" "mediaservice\qtmedia_audioengine.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\platforms\qwin dows.dll" "platforms\qwindows.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\playlistformat s\qtmultimedia_m3u.dll" "playlistformats\qtmultimedia_m3u.dll"
"E:\BMS\Qt\5.12.4\mingw73_64\plugins\styles\qwindow svistastyle.dll" "styles\qwindowsvistastyle.dll"


Then I have to add SSL 64 bits dll. I am not too sure the ones I have to include so I put all of them, the 6 that are in my OpenSSL 1.1.1h bin folder:

capi.dll
dasync.dll
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
ossltest.dll
padlock.dll

My installer looks ready. First run I get an error message saying that the software cannot be run cause the library "libgcc_s_seh-1.dll" is missing.

So I added this dll in my Inno Setup Compiler script:

[Files]
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Core.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Gui.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Multimedia.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Network.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Svg.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\Qt5Widgets.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\libGLESv2.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\libEGL.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\D3DCompiler_47.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\opengl32sw.dll"; DestDir: "{app}\"; Flags: ignoreversion
; the next one is not listed by windeployqt.exe
Source: "E:\BMS\Qt\5.12.4\mingw73_64\bin\libgcc_s_seh-1.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "E:\BMS\Qt\Tools\mingw530_32\bin\libgcc_s_dw2-1.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\Tools\mingw530_32\bin\libstdc++-6.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "E:\BMS\Qt\Tools\mingw530_32\bin\libwinpthread-1.dll"; DestDir: "{app}\"; Flags: ignoreversion

Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\audio\qtaudio_ windows.dll"; DestDir: "{app}\audio"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\bearer\qgeneri cbearer.dll"; DestDir: "{app}\bearer"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\iconengines\qs vgicon.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q gif.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q icns.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q ico.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q jpeg.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q svg.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q tga.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q tiff.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q wbmp.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\imageformats\q webp.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\mediaservice\d sengine.dll"; DestDir: "{app}\mediaservice"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\mediaservice\q tmedia_audioengine.dll"; DestDir: "{app}\mediaservice"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\platforms\qwin dows.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\playlistformat s\qtmultimedia_m3u.dll"; DestDir: "{app}\playlistformats"; Flags: ignoreversion
Source: "E:\BMS\Qt\5.12.4\mingw73_64\plugins\styles\qwindow svistastyle.dll"; DestDir: "{app}\styles"; Flags: ignoreversion

Source: "D:\Svn\Scanner\build-******Scan-Qt_5_12_4_mingw73_64-Release\release\**********_Scanner.exe"; DestDir: "{app}\"; Flags: ignoreversion

Source: "E:\BMS\OpenSSL-Win64\bin\capi.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\BMS\OpenSSL-Win64\bin\dasync.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\BMS\OpenSSL-Win64\bin\libcrypto-1_1-x64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\BMS\OpenSSL-Win64\bin\libssl-1_1-x64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\BMS\OpenSSL-Win64\bin\ossltest.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\BMS\OpenSSL-Win64\bin\padlock.dll"; DestDir: "{app}"; Flags: ignoreversion

Then I got an error saying that the software cannot be started correctly. Like an instant crash while it is working fine in Qt Creator. So I have few questions:

1. Why windeployqt is listing 3 dll from "mingw530_32"?
2. Why windeployqt does not list "mingw73_64\bin\libgcc_s_seh-1.dll"?
3. Could this explain why the software cannot start correctly?
4. Is there a way to know which dll from openSSL I am supposed to include?

Thank you!

d_stranz
23rd November 2020, 17:55
Why windeployqt is listing 3 dll from "mingw530_32"?
No idea. But if you are building a 64-bit distro, then you should be deploying 64-bit versions of these DLLs.

Why windeployqt does not list "mingw73_64\bin\libgcc_s_seh-1.dll"?
It is possible that some other DLL loads this dynamically (at runtime) so the dependency can't be discovered by windeployqt.

Like an instant crash while it is working fine in Qt Creator.

3. Could this explain why the software cannot start correctly?

Usually an "instant crash" is because of a bug - an uninitialized variable, accessing an invalid memory address (a NULL pointer, or outside the bounds of an array), etc. The environment inside of Qt Creator is different from running the program standalone.

gaetan_tl
24th November 2020, 15:15
For the 3 DLL listed in mingw530_32 I found "libstdc++-6.dll" and "libwinpthread-1.dll" in mingw730_64 so I use those one instead.
However I cannot find a 64-bit version of "libgcc_s_dw2-1.dll". I remove this dll from the installer since it is a 32-bit version anyway.

The software looks to work properly with those modifications.
I still need to do more test in order to make sure that all the features are working despite the lack of "libgcc_s_dw2-1.dll".
Is there a way to have an exhaustive list of all the dll that should be imported when building an installer or windeployqt is the only/best option?

I was pretty sure that the instant crash was not due to a NULL pointer exception.
The error message was saying that the software couldn't start properly. Usually when it is a NULL pointer it says something like "the software encountered an unexpected error and had to be closed" not that it can't even be started.

d_stranz
6th December 2020, 21:15
The error message was saying that the software couldn't start properly.

Then that points to a missing DLL. If the DLL can't be loaded, then the program can't run.