Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Executable won't run after windeployqt

    General and Desktop
    4
    7
    250
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ocgltd
      ocgltd last edited by ocgltd

      I have a simple qt (mostly QML) app built in Win10-64 with Qt Creator. I tried using windeployqt as per directions I found online, and according to the output it found and copied all necessary files.

      BUT...when I try to run myapp.exe from the directory windeployqt filled with DLL's, nothing happens. I'm running from the command prompt, and there are no errors/messages, just return back to the prompt.

      I don't see any error in the system event viewer either.

      What is going wrong?

      ocgltd 1 Reply Last reply Reply Quote 0
      • J.Hilk
        J.Hilk Moderators @ocgltd last edited by

        @ocgltd said in Executable won't run after windeployqt:

        After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).

        I'm not sure why there is no error output to stdout/stderr but I'll report back on results

        that sounds about right, the windeployqt tool needs to know where your source qml files are, so it can parse them and fetch everything they import from the QT directory the --qmldir argument followed by the path to your qml files(folder) (main.qml etc)

        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct

        Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply Reply Quote 2
        • ocgltd
          ocgltd @ocgltd last edited by ocgltd

          After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).

          I'm not sure why there is no error output to stdout/stderr but I'll report back on results

          JKSH J.Hilk 2 Replies Last reply Reply Quote 0
          • JKSH
            JKSH Moderators @ocgltd last edited by JKSH

            @ocgltd said in Executable won't run after windeployqt:

            After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).

            If your QML files are in a .qrc, then you don't neeed to tell windeployqt about them. [EDIT: See @J-Hilk's reply below]

            However, you might need to tell windeployqt to copy the built-in Qt QML files/plugins.

            I'm not sure why there is no error output to stdout/stderr but I'll report back on results

            Do you see anything in DebugView? https://docs.microsoft.com/en-us/sysinternals/downloads/debugview

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply Reply Quote 0
            • J.Hilk
              J.Hilk Moderators @ocgltd last edited by

              @ocgltd said in Executable won't run after windeployqt:

              After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).

              I'm not sure why there is no error output to stdout/stderr but I'll report back on results

              that sounds about right, the windeployqt tool needs to know where your source qml files are, so it can parse them and fetch everything they import from the QT directory the --qmldir argument followed by the path to your qml files(folder) (main.qml etc)

              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct

              Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply Reply Quote 2
              • ocgltd
                ocgltd last edited by

                OK solved. I needed to add the --qmldir option. So even though all of my QML files are in a QRC file, the windployqt program still needs to scan those file to find imports used by those files.

                As well, I had to add the compiler runtime option.

                Now it runs.

                1 Reply Last reply Reply Quote 2
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  Hi,

                  windeployqt does not inspect the executable content, it's not a decompiler. That's why you have to use qmldir to point to your sources for it to do its work.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  ocgltd 1 Reply Last reply Reply Quote 2
                  • ocgltd
                    ocgltd @SGaist last edited by

                    @SGaist I get it now - but this would be a really nice explanation to add to the online documentation.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post