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

Can't generate my Release version.



  • Hi, I make a program with QT 5.14.1 I'm done with the debug phase and my objective was to make an executable that can be run on a computer without Qt install on it.

    I found two solutions:

    first is to make a static build at this place,but to know how but to know how hard/long is to make qmake, i wan't to avoid this solution.

    So i found this second solution:
    The Windows Deployment Tool that I need this post to understand how it work. So with the command prompt i enter this command:

    C:>cd C:\Qt\5.14.1\mingw73_32\bin
    C:\Qt\5.14.1\mingw73_32\bin> windeployqt.exe C:\Users\Alexandre\source\Qt\QT_Version_registre_Alim\build-registreAlimentation-Desktop_Qt_5_14_1_MinGW_32_bit-Release

    everything goes fine, when i try to lauch the Exe i got 0xc00007b error like on the stack post. I use Depends like recommanded on the post an see that over 500 dll are missing like
    API-MS-Win-Eventing-Consumer-L1-1-0.dll
    API-MS-Win-Eventing-Controller-L1-1-0.dll

    so can I fixe it with windeployqt? because i don't wanna do it manually... yes i technally can but found that so absurd. That's my first question.

    also, my windeployqt get corrupt afther that i got an "access is denied". This is normal? Also, i try to run windeployqt in administrator prompt, because i tougth the reason that windeployqt not generate the dll was because it haven't the authorisation. This is could be the reason of the corruption? I try to restart my computer, but now i got missing dll, but
    I already found the solutionsolution, but i'm curious to know if it have a reason.

    My second question is that make me questionning about the perpose of all of that, i mean i pass more time to generate the my file or my qmake then the time that i take coding. To be honest it 4 days to 2 days of coding.
    So that mean two things it's that i don't understand clearly how QT work and why is work like that or it's an enificient ways to work. I suppose it's the first one. To me Qt it's an environnement to make it easier to code and maintaint the code on multiple platform, but EACH time i try to exploit that force I always finish taking more time trying to figure it out how to generate file than working on my project. So it's is normal? Can some one explain me the philosophy of the generation of file because more i try to understand more it's seems big and really not easy to use.

    Thanks to reading.


  • Moderators

    Let's step back a bit.

    First: Make sure you can run your Release executable from Qt Creator. Does that work?

    @CrazyCreepy said in Can't generate my Realese version.:

    Can some one explain me the philosophy of the generation of file because more i try to understand more it's seems big and really not easy to use.

    When you use DLLs, your program's code is split between your executable file (.exe) and the libraries (.dlls). All of them need to be found before your program can run.

    "Deployment" means to copy the required DLLs into your executable's folder. Tools like windeployqt help you to do this automatically:

    I use Depends like recommanded on the post an see that over 500 dll are missing like
    API-MS-Win-Eventing-Consumer-L1-1-0.dll
    API-MS-Win-Eventing-Controller-L1-1-0.dll

    Dependency Walker is too old. It doesn't work correctly on newer versions of Windows. The errors about API-MS-Win-*.dll are not real -- you can ignore them.

    also, my windeployqt get corrupt afther that i got an "access is denied". This is normal?

    No, this is not normal. I suspect there is an issue with your PC itself.

    Next time you see "access is denied", reboot your PC and try again.

    Also, i try to run windeployqt in administrator prompt, because i tougth the reason that windeployqt not generate the dll was because it haven't the authorisation.

    You should not need to run windeployqt as Administrator.

    All you need is permissions to read C:\Qt\5.14.1\mingw73_32\bin and permissions to write C:\Users\Alexandre\source\Qt\QT_Version_registre_Alim\build-registreAlimentation-Desktop_Qt_5_14_1_MinGW_32_bit-Release

    I try to restart my computer, but now i got missing dll

    This sounds very, very bad! What DLLs were missing?

    EACH time i try to exploit that force I always finish taking more time trying to figure it out how to generate file than working on my project. So it's is normal?

    It is normal for the first few times, because you are learning something new.

    Take notes about what what you tried. Record what works and what doesn't work. Record the problems you encountered. Next time you deploy a program, read and follow your notes. This should make things much faster.

    After I finish writing or editing my code, it normally takes me only a few minutes to deploy my executable. However, if there is a problem, it might take me an extra few hours to resolve it.



  • @JKSH Thanks for the reply that help, but i have many more question.

    1. @JKSH said in Can't generate my Realese version.:

    First: Make sure you can run your Release executable from Qt Creator. Does that work?

    Nope, yesterday it was workin now it won't...
    Edit: I found why i can't run mingWin32 but i can run mingWin64.
    In mingWin32 i only get
    this
    any tips to solved it?
    Also, when i try windeployqt in mingWin64 Qt folder i got an access is denied and if i try to check the Dependency i got: corrupt_file

    1. @JKSH said in Can't generate my Realese version.:

    When you use DLLs, your program's code is split between your executable file (.exe) and the libraries (.dlls).

    Nice that that what i understand, but this isn't make the deployment more hard because if i make two program, for the exemple, and those two used Qt5Core.dll. If I use windeployqt with this application generate the dll inside my folder. so if i make Installer with InnoSetup this gonna use two time the same dll. Also, if a third party use Qt and use the same DLL isn't more effective to put the dll at one place and all program use the same DLL?

    1. @JKSH said in Can't generate my Realese version.:

    All you need is permissions to read C:\Qt\5.14.1\mingw73_32\bin and permissions to write C:\Users\Alexandre\source\Qt\QT_Version_registre_Alim\build-registreAlimentation-Desktop_Qt_5_14_1_MinGW_32_bit-Release

    How I check if Permission is correct or does it have a method?

    1. @JKSH said in Can't generate my Realese version.:

    This sounds very, very bad! What DLLs were missing?

    Most of it are API-MS-Win-*.dll and EXT-MS-WIN-SESSION*.dll
    I found on this site CFF Explorer that I use and found that i got libwinpthread-1.dll and libstdc++-6.dll missing. Also, CFF Explorer can't find API-MS-Win-*.dll but i have could run windeployqt normaly.

    Here the Screen shot
    C:\Users\Alexandre>cd C:\Qt\5.14.1\mingw73_32\binC:\Qt\5.14.1\mingw73_32\bin>windeployqt.exe C:\Users\Alexandre\source\Qt\QT_Version_registre_Alim\build-registreAlimentation-Desktop_Qt_5_14_1_MinGW_32_bit-ReleaseC:\Users\Alexandre\source\Qt\QT_Version_registre_Alim\build-registreAlimentation-Desktop_Qt_5_14_1_MinGW_32_bit-Release\registreAlimentation.exe 32 bit, release executableAdding Qt5Svg for qsvgicon.dllSkipping plugin qtvirtualkeyboardplugin.dll due to disabled dependencies (Qt5Qml Qt5Quick).Skipping plugin qtvirtualkeyboard_hangul.dll due to disabled dependencies (Qt5Qml Qt5Quick).Skipping plugin qtvirtualkeyboard_openwnn.dll due to disabled dependencies (Qt5Qml Qt5Quick).Skipping plugin qtvirtualkeyboard_pinyin.dll due to disabled dependencies (Qt5Qml Qt5Quick).Skipping plugin qtvirtualkeyboard_tcime.dll due to disabled dependencies (Qt5Qml Qt5Quick).Skipping plugin qtvirtualkeyboard_thai.dll due to disabled dependencies (Qt5Qml Qt5Quick).Direct dependencies: Qt5Core Qt5Gui Qt5Widgets Qt5XmlAll dependencies   : Qt5Core Qt5Gui Qt5Widgets Qt5XmlTo be deployed     : Qt5Core Qt5Gui Qt5Svg Qt5Widgets Qt5XmlUpdating Qt5Core.dll.Updating Qt5Gui.dll.Updating Qt5Svg.dll.Updating Qt5Widgets.dll.Updating Qt5Xml.dll.Updating libGLESV2.dll.Updating libEGL.dll.Updating D3Dcompiler_47.dll.Updating opengl32sw.dll.Updating libgcc_s_sjlj-1.dll.Updating libstdc++-6.dll.Updating libwinpthread-1.dll.Updating qsvgicon.dll.Updating qgif.dll.Updating qicns.dll.Updating qico.dll.Updating qjpeg.dll.Updating qsvg.dll.Updating qtga.dll.Updating qtiff.dll.Updating qwbmp.dll.Updating qwebp.dll.Updating qwindows.dll.Updating qwindowsvistastyle.dll.Creating qt_ar.qm...Creating qt_bg.qm...Creating qt_ca.qm...Creating qt_cs.qm...Creating qt_da.qm...Creating qt_de.qm...Creating qt_en.qm...Creating qt_es.qm...Creating qt_fi.qm...Creating qt_fr.qm...Creating qt_gd.qm...Creating qt_he.qm...Creating qt_hu.qm...Creating qt_it.qm...Creating qt_ja.qm...Creating qt_ko.qm...Creating qt_lv.qm...Creating qt_pl.qm...Creating qt_ru.qm...Creating qt_sk.qm...Creating qt_uk.qm...Creating qt_zh_TW.qm...

    I try to run my application but it continue to have a 0x000007b error. I use CFF Explorer, but find nothing missing except API-MS-Win-*.dll so i don't understand why I can't run it.
    Edit: i understand why is not working is because the 32 byte version can't compile in Qt (see 1. )

    1. @JKSH said in Can't generate my Realese version.:

    It is normal for the first few times, because you are learning something new.
    Take notes about what what you tried. Record what works and what doesn't work. Record the problems you encountered. Next time you deploy a program, read and follow your notes. This should make things much faster.
    After I finish writing or editing my code, it normally takes me only a few minutes to deploy my executable. However, if there is a problem, it might take me an extra few hours to resolve it.

    ok, I will take your tips.

    1. ofthen in Qt Documentation i found QML use. This is a must to know when you use Qt?
      I found the explaination here, but to be honest i never use it. Well no one try to teach me this, so i thougth is was not pertinent.

    thanks for the help.



  • @CrazyCreepy I finaly made it, the days afther the previous post but i missing time to show my solution. For people that had similar issue here the tips:

    When you try to use Qt each compiler get it's folder with it's own qmake and windeployqt.
    thing to know:

    • the qmake create the .exe of your solution.
    • windeployqt automatise the placement of dll in a exe folder.
    • API-MS-Win-*.dll and EXT-MS-WIN-SESSION*.dll seems missing but the computer know how to find it.

    To reach the functionnal appliction you need 4 thing:

    1. that all dll are in the correct folder of the compiler
    2. that your project compile without fault in the Qt creator or Visual studio
    3. open a console in your bin compiler folder
    4. enter this parameter --realese --forced /path/of/your/exe to be sure that going to work, but forced aren't necessary. If you don't but --realese the windeployqt may link the debug dll instead of realese dll.

    msvc20xx et msvc20xx_64 are for visual studio qt compilator need it, you need to get you file there.

    that doesn't solve the issue of access is denied but if you had multiple compilator that can be an alternative.
    if it's possible.

    Also that doesn't explain why this method is implemented this way in Qt.

    hope that may help you.


Log in to reply