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

Deployed exe not working on same computer



  • Hello. I compiled my project with Release profile. Somehow though I chose Release in shadow build folder it creates both debug and release folders and the release one is completely empty. But in the debug folder I could find my executable.
    Then I placed it in separate folder and using mingw terminal used windeployqt.exe on it. It created me a list of DLL and folders inside the directory and according to different tutorials I've seen on the internet my application should launch from that directory. But it doesn't. I get no error messages, just nothing happens.
    I've tried another method where I manually copied all the DLLs into the folder with my executable, but I get the same result.
    This post is about the same issue, but in my case windeployqt.exe already created those files that helped him.
    Any suggestions would be appreciated.


  • Moderators

    @PavloPonomarov said in Deployed exe not working on same computer:

    Hello. I compiled my project with Release profile. Somehow though I chose Release in shadow build folder it creates both debug and release folders and the release one is completely empty. But in the debug folder I could find my executable.

    Sounds like something has gone wrong at this step. I wouldn't try to deploy the app until you can get a Release build to appear in the release folder.

    Questions:

    1. If you create a new "Hello world" app, can you get a Release build to appear in the release folder?
    2. If "Yes" to #1, can you deploy that app and run it?
    3. What external libraries (if any) are used by your project?
    4. If your project uses Qt Quick/QML, did you deploy the QML files (including qmldir)? See https://wiki.qt.io/Deploy_an_Application_on_Windows

  • Moderators

    @PavloPonomarov said in Deployed exe not working on same computer:

    Hello. I compiled my project with Release profile. Somehow though I chose Release in shadow build folder it creates both debug and release folders and the release one is completely empty. But in the debug folder I could find my executable.

    Sounds like something has gone wrong at this step. I wouldn't try to deploy the app until you can get a Release build to appear in the release folder.

    Questions:

    1. If you create a new "Hello world" app, can you get a Release build to appear in the release folder?
    2. If "Yes" to #1, can you deploy that app and run it?
    3. What external libraries (if any) are used by your project?
    4. If your project uses Qt Quick/QML, did you deploy the QML files (including qmldir)? See https://wiki.qt.io/Deploy_an_Application_on_Windows


  • @PavloPonomarov said in Deployed exe not working on same computer:

    Somehow though I chose Release in shadow build folder it creates both debug and release folders and the release one is completely empty. But in the debug folder I could find my executable.

    Are you sure you are looking at the right folder?
    If you configure the project by the default configuration of Qt Creator and have built in both debug and release, there should be two building folders, one is named build-xxx-Debug and the other is build-xxx-Release.
    Both will have debug and release subfolders in them, but the build-xxx-Debug one will have an empty release and the build-xxx-Release one will have an empty debug.

    But this is a different issue from deployment.
    Are you able to run your application successfully from Qt creator before having called windeployqt.exe?



  • @Bonnie said in Deployed exe not working on same computer:

    Both will have debug and release subfolders in them, but the build-xxx-Debug one will have an empty release and the build-xxx-Release one will have an empty debug.

    Exactly. I have two folders - build-xxx-Debug and build-xxx-Release, but both of them have executables in debug and empty release

    Are you able to run your application successfully from Qt creator before having called windeployqt.exe?

    Yes, it compiles and runs without problems

    @JKSH said in Deployed exe not working on same computer:

    1. If you create a new "Hello world" app, can you get a Release build to appear in the release folder?
    2. If "Yes" to #1, can you deploy that app and run it?

    I took an example and made a release version. It created executable in release and I could deploy and run it. I have compared Release Build Settings from the example and from my project - they are equal.

    1. What external libraries (if any) are used by your project?

    I don't use external libraries

    1. If your project uses Qt Quick/QML, did you deploy the QML files (including qmldir)? See https://wiki.qt.io/Deploy_an_Application_on_Windows

    Thanks for this link. I do use Qml and I just tried "quick and dirty" method and it worked! So now I'll have to do the "clean up". Still strange that Release version creates executable in debug directory though


  • Moderators

    @PavloPonomarov said in Deployed exe not working on same computer:

    I do use Qml and I just tried "quick and dirty" method and it worked!

    Awesome :)

    You were probably missing QML-related files.

    Try the --qmldir and --qmlimport options of windeployqt


Log in to reply