[solved] Deploying Qt on Windows?



  • Hi,
    how deploying Qt on Windows can be such difficult?

    I'm trying to deploy my app on Windows, so I could sent it to someone to test it. But, I cannot even make an .exe which could start on my own computer without Qt creator?

    I have tried the following:

    1. make release-build on Qt creator
    2. Copy the resulting .exe-file to elsewhere
    3. Try to start it.

    In the beginning, the .exe says that it needs some .dll files. (Of course.)
    I have copied the requested .dll's from C:\Qt\5.3\mingw482_32\bin, but after that, I just get message
    @The application was unable to start correctly (0xc000007b). Click OK to close the application@

    After that, I have tried windeployqt on command line.
    I have used it like:
    @

    cd C:\Qt\5.3\mingw482_32\bin // This is the path where windeployqt.exe lies
    set PATH=C:\Qt\5.3\mingw482_32\bin // Windeployqt want to know where .dll's are
    windeployqt C:\path\to\my\exe

    @

    Which seems to run well and adds .exe's directory full of files, but after all, when I try to start that .exe, it says that it needs some dll's. (As far as I remembe, atleast something like libgcc_s_dw2-1 and libwinpthread-1).
    I have copied those from C:\Qt\5.3\mingw482_32\bin, but once again, the app gives just (0xc000007b) error.

    I have also tried to look that .exe with dependency walker, but I got same problems as here:
    http://stackoverflow.com/questions/17023419/win-7-64-bit-dll-problems , so dependency walker is probably just trying to mislead me for now.

    I don't understand what I have done wrong?

    p.s. I'm running Windows 7 64-bit.





  • Did you also supply the qwindows.dll?

    Application Directory should be setup as:

    icudt51.dll
    icuin51.dll
    icuuc51.dll
    libstdc++-6.dll
    platforms/qminimal.dll (probably not required)
    platforms/qwindows.dll
    libgcc_s_dw2-1.dll
    Q*.dll
    http://stackoverflow.com/questions/17377706/cannot-run-my-exe-file-on-another-computer-application-requested-the-runtime-t/19136598#19136598

    Edit: Typo fix libstc++-6.dll => libstdc++-6.dll



  • [quote author="GrahamL" date="1406709213"]Hi
    Have you read this guide?
    http://qt-project.org/doc/qt-5/windows-deployment.html[/quote]

    Yes, I have been reading it, and tons of other "deploy Qt for windows"-threads and guides. But...
    ...shouldn't windeployqt do all that for me?
    ...if i try to run nmake on windows command line, it says
    @ 'nmake' is not recognized as an interlan or external command, operable program or batch file.@
    Probably I'm doing something wrong, but I don't know what...

    [quote author="NetZwerg" date="1406709338"]Did you also supply the qwindows.dll?

    Application Directory should be setup as:

    icudt51.dll
    icuin51.dll
    icuuc51.dll
    libstc++-6.dll
    platforms/qminimal.dll (probably not required)
    platforms/qwindows.dll
    libgcc_s_dw2-1.dll
    Q*.dll
    http://stackoverflow.com/questions/17377706/cannot-run-my-exe-file-on-another-computer-application-requested-the-runtime-t/19136598#19136598[/quote]
    !!!
    I looked at folder where I had ran windeployqt + added all dll's that my program.exe had asked for.
    It did NOT had
    libstc++-6.dll or
    platforms/qminimal.dll
    in it.

    They all were also missing from my C:\Qt\5.3\mingw482_32\bin.
    But I found
    libstdc++-6.dll
    from there, and tried to add it to my app folder.
    AND IT WORKED!!

    I don't understand why I don't have libstc++-6.dll or why my app didn't asked for it.

    But anyway, THANKS! You saved tons of my time! I'll mark this as solved as soon as I can confirm that my app runs also on someone else's computer.



  • Typo on my side. Funny noone reconized this on my SO-Post ... gonna change both


  • Lifetime Qt Champion

    Hi,

    In any case there's also this very good wiki "entry":http://qt-project.org/wiki/Deploy_an_Application_on_Windows



  • [quote author="NetZwerg" date="1406726719"]Typo on my side. Funny noone reconized this on my SO-Post ... gonna change both[/quote]
    Ok, that explains a lot of thing.

    I tried to do this also without windeployqt, and it seems to work also.

    So, one way to make Qt app to work on any PC (if i still remember what I did) is this:

    1. Make release build on Qt Creator
    2. Copy yourapp.exe to a new, clean folder
    3. Try to run it
      3.1 Your app will say that it needs some .dll files. Copy them one per time from C:\Qt\5.3\mingw482_32\bin to the folder where your app is.
      3.2 Now your app will give 0xc000007b error. NOW add libstdc++-6.dll and platforms/qwindows.dll manyally with it.
    4. Now your app starts to ask for some more .dll files. Add them from same location as in step 3.1
    5. Enjoy your running app!
      (6. do NOT trust dependency walker - it is not going to help you.)

    I can now confirm that this has atleast worked on two different Win7-machines without Qt installed.

    Or actually, sounds are still not working. Does anybody know what could be wrong with them?
    (Yes, I did ship them with the App, and they DO work on my computer. Could it be something related to Qt multimedia? Sounds are played via QSound.)

    [quote author="SGaist" date="1406756512"]Hi,

    In any case there's also this very good wiki "entry":http://qt-project.org/wiki/Deploy_an_Application_on_Windows[/quote]
    Ok, that guide looks also pretty good. Thanks! Weird that I could't find it when trying to solve this issue, maybe it would need some search-engine-optimization....

    p.s. I know that this is a dumb question, but it is legal to ship and publish all those .dll files with your app?


  • Moderators

    Hi,

    [quote]p.s. I know that this is a dumb question, but it is legal to ship and publish all those .dll files with your app?[/quote]That's not a dumb question at all, don't worry. :) The answer is: Yes it's legal, as long as you abide by the LGPL license.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.