Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

windeployqt.exe comes with QT 5.14 Not copy the dlls to the app directory



  • Hello

    I download the last new version of the QT which is 5.14, I make a release for a test app, and when i tried to use windeployqt.exe to copy the dll files to the exe folder like what i did in almost all versions of QT and it worked, but in the new version it not copy the dlls here is what i used

    C:\Qt\Qt5.14.0\5.14.0\mingw73_32\bin\windeployqt.exe app.exe
    

    it gives me this without copy the dlls to the folder

    D:\FreeLancer\AmazonKinese\build-test-Desktop_Qt_5_14_0_MinGW_32_bit-Release\test\app.exe 32 bit, release executable
    Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
    All dependencies   : Qt5Core Qt5Gui Qt5Widgets
    To be deployed     : Qt5Core Qt5Gui Qt5Widgets
    Unable to find the platform plugin.
    

    so it's very strange problem, is there any new additional parameters i need to add for the new version of QT to make it work?



  • Hi, I just installed 5.14 today and have the same problem for the MinGW version (but windeployqt still works ok for the MSVC2017 version of 5.14).

    There a 2 differences between this version 5.14 of MinGW and previous versions of Qt like 5.13.2: there are only version of MinGW .dlls like Qt5Core.dll (the MSVC2017 version of 5.14 still has 2: Qt5Core.dll and Qt5Cored.dll)

    When you build your .exe file with MinGW 5.14 there is Build... directory created (same as before), but not the subdirectories Release or Debug (the MSVC2017 version of 5.14 still creates those subdirectories).

    Since you can run the .exe file in Qt Creator obviously the platform plugin is there, even in 5.14 :-) so this could be a bug in windeployqt, perhaps because of the changes I mentioned above.

    I think I will download Qt sources for 5.14 and check the code for windeployqt, I'll post again.



  • It was more or less connected :-) the platform plugin dll is usually qwindows.dll and it has changed between 5.13.2 and 5.14, it's not a change in C++ code but in the flags for the .dll, if you run MSVC's dumpbin.exe/header on the MinGW 5.13.2 qwindows.dll you get:

    Executable
    Line numbers stripped
    Symbols stripped
    32 bit word machine
    Debug information stripped
    DLL
    

    and if you run the dumpbin/header on the MinGW 5.14.0 qwindows.dll you get:

    Executable
    Line numbers stripped
    32 bit word machine
    DLL
    

    the difference is not much, only those ...STRIPPED... flags, but it's enough to confuse windeployt, the relevant code is in qt-everywhere-src-5.14.0/qttools/src/shared/winutils/utils.cpp line 828 and line 829:

    ...
    // Use logic that's used e.g. in objdump / pfd library
    *isDebugIn = !(nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED);
    ...
    

    because this is never true in MinGW 5.14.0 the ! will cause *isDebugIn to be always true, i.e. windeployqt thinks that qwindows.dll is debug flavored and not a good match for your release flavored .exe :-(

    But then windeployin debug flavored builds should still work in MinGW 5.14.0, right? Nice try, but sorry. It will instead complain about the lack of the *d.dll suffixed .dlls, .e.g. it does not find Qt5Cored.dll.

    I'll file a bug report once I had some coffee.



  • ok, https://bugreports.qt.io/browse/QTBUG-80806 submitted
    I only had to report about the release build problem. the debug build problems that there are no .dll's with a d.dll suffix was already reported 2 days ago:
    https://bugreports.qt.io/browse/QTBUG-80763

    If you promise you will only use windeployqt for Release builds I can give you a patched windeployqt.exe...

    Edit: I patched that line 829, to

    *isDebugIn = false;
    

    and rebuilt windeployqt to a new .exe, called it windeployqtreleaseonly
    Drop it into C:\Qt\5.14.0\mingw73_32\bin and you're good to go.



  • @hskoglund Thank you very much for the greate effort



  • @hskoglund said in windeployqt.exe comes with QT 5.14 Not copy the dlls to the app directory:

    ok, https://bugreports.qt.io/browse/QTBUG-80806 submitted
    I only had to report about the release build problem. the debug build problems that there are no .dll's with a d.dll suffix was already reported 2 days ago:
    https://bugreports.qt.io/browse/QTBUG-80763

    If you promise you will only use windeployqt for Release builds I can give you a patched windeployqt.exe...

    Edit: I patched that line 829, to

    *isDebugIn = false;
    

    and rebuilt windeployqt to a new .exe, called it windeployqtreleaseonly
    Drop it into C:\Qt\5.14.0\mingw73_32\bin and you're good to go.

    @hskoglund 64bit version , pls. Thanks for your contribution.



  • @catshy Here you go: windeployqt64releaseonly

    Same here, drop the .exe in your C:\Qt\5.14.0\mingw73_64\bin and hopefully this will be a good start for your 2020 :-)



  • @hskoglund Well Done. This solved my problem very well and best wishes for 2020 :+)



  • @hskoglund Seems that nobody at Qt gives a... nything about this bug? It's a year later and 5.15.2 apparently still suffers from the very same issue. Thank you for the patched windeployqt version!



  • @hskoglund @hskoglund i am also facing same problem...can you please give me a soluntion detail way?
    :)
    thanks in Advance


  • Moderators

    This post is deleted!


  • @hskoglund: thx man, you saved my day :)



  • @bogdan_bdg said in windeployqt.exe comes with QT 5.14 Not copy the dlls to the app directory:

    @hskoglund Seems that nobody at Qt gives a... nything about this bug? It's a year later and 5.15.2 apparently still suffers from the very same issue. Thank you for the patched windeployqt version!

    Worse, the conan package for Qt 5.15.2 has the same problem and the patched binary can't just be dropped in.

    Edit: Actually it is fixed. The --debug flag specifies installing the debug versions, not, as was posted elsewhere on the internet, turning on debug output for windeployqt.



  • @hskoglund Oh yeah, thank you very much for your patched versions. Sadly, those are still required in Qt 5.15.2 (working also with C:\Qt\5.15.2\mingw81...... )


Log in to reply