Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Unable to build standalone .exe using windeployqt.
Forum Updated to NodeBB v4.3 + New Features

Unable to build standalone .exe using windeployqt.

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 4 Posters 4.1k Views 2 Watching
  • 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.
  • A Offline
    A Offline
    Aditya1309
    wrote on last edited by
    #1

    Hi,
    I am trying to build an distributional executable using windeployqt, but I am not able to make standalone exe. After I move the exe to other location it throws up Qt5Widgetsd.dll is missing from your computer.

    Regards,
    Aditya.

    jsulmJ JKSHJ 2 Replies Last reply
    0
    • A Aditya1309

      Hi,
      I am trying to build an distributional executable using windeployqt, but I am not able to make standalone exe. After I move the exe to other location it throws up Qt5Widgetsd.dll is missing from your computer.

      Regards,
      Aditya.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Aditya1309 said in Unable to build standalone .exe using windeployqt.:

      After I move the exe to other location it throws up Qt5Widgetsd.dll is missing from your computer.

      Do you move all the libs and plug-ins as well? How does your deployment folder look like after windeployqt run?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      1
      • A Aditya1309

        Hi,
        I am trying to build an distributional executable using windeployqt, but I am not able to make standalone exe. After I move the exe to other location it throws up Qt5Widgetsd.dll is missing from your computer.

        Regards,
        Aditya.

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @Aditya1309 said in Unable to build standalone .exe using windeployqt.:

        I am trying to build an distributional executable using windeployqt, but I am not able to make standalone exe.

        You need to distribute the DLLs too.

        Qt5Widgetsd.dll

        If your executable is looking for Qt5Widgetsd.dll, that means you created a Debug build.

        You should distribute a Release build instead.

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

        A 1 Reply Last reply
        1
        • jsulmJ jsulm

          @Aditya1309 said in Unable to build standalone .exe using windeployqt.:

          After I move the exe to other location it throws up Qt5Widgetsd.dll is missing from your computer.

          Do you move all the libs and plug-ins as well? How does your deployment folder look like after windeployqt run?

          A Offline
          A Offline
          Aditya1309
          wrote on last edited by
          #4

          @jsulm said in Unable to build standalone .exe using windeployqt.:

          How does your deployment folder look like after windeployqt run?

          It contains all dll including Qt5Widgetsd.dll. But when I move .exe to other location it does not work. I have compiled it in debug build.

          1 Reply Last reply
          0
          • JKSHJ JKSH

            @Aditya1309 said in Unable to build standalone .exe using windeployqt.:

            I am trying to build an distributional executable using windeployqt, but I am not able to make standalone exe.

            You need to distribute the DLLs too.

            Qt5Widgetsd.dll

            If your executable is looking for Qt5Widgetsd.dll, that means you created a Debug build.

            You should distribute a Release build instead.

            A Offline
            A Offline
            Aditya1309
            wrote on last edited by
            #5

            @JKSH Thanks, Indeed I used a debug build, But when I compile using release I still face the same issue. I see two different build i.e build-<app-32-bit>-debug and build-<app-32-bit>-release. This time I used release and used windeployqt.exe <location to release exe.. [build-<app-32-bit>-release]> still facing the same issue.

            jsulmJ 1 Reply Last reply
            0
            • A Aditya1309

              @JKSH Thanks, Indeed I used a debug build, But when I compile using release I still face the same issue. I see two different build i.e build-<app-32-bit>-debug and build-<app-32-bit>-release. This time I used release and used windeployqt.exe <location to release exe.. [build-<app-32-bit>-release]> still facing the same issue.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Aditya1309 Do you only move the exe? If so, then how could it work? You need to move the whole deployment directory.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • Paul ColbyP Offline
                Paul ColbyP Offline
                Paul Colby
                wrote on last edited by
                #7

                Hi @Aditya1309,

                It sounds like you're a little confused about the concepts here... specifically how windeploy qt affects the exe (or rather doesn't affect it). Let me see if I can shed some light on the typical process for building a distributable for Windows:

                1. When you build the application (let's call it MyApp), the build process generates, for example, MyApp.exe - this is not a standalone exe (unless your using Qt with static linking, which is a whole other topic).

                2. Next, you may use windeployqt to gather all of the dependencies (that it can detect) into the same directory as the MyApp.exe. This is still not a standalone app - its an exe, along with a set of dll's, that must (in most cases) stay together.

                3. Finally, if you wish, you can generate an installer application, for example InstallMyApp.exe (or InstallMyApp.msi). This is a standalone (installer) app - or at least it should be if your installer framework is any good.

                The installer produced in step 3 would typically "install" (ie copy) the MyApp.exe app from step 1, along with all of the dependencies from step 2, into some destination folder. But at no point did MyApp.exe become a "standalone" app - you still cannot simply copy it out and use it without the other dll's being present.

                There are two exceptions:

                1. if the dependent dll's are present elsewhere on the target machine, then sometimes copying just the MyApp.exe will work - this often happens on development machines, then fails for example when distributed to end users. Don't rely on this.
                2. it is possible to statically link Qt - the default Qt installation does not support this (at least not the last time I checked), so it requires you to build Qt from source, with static-linking enabled. (Note, this has important licensing considerations!) However, if you do this, then you should not need to use windeployqt at all (or more specifically, windeployqt would only pick up on non-Qt dependencies that weren't also statically linked).

                I hope that gives you a bit of a better idea of what's going on, and why you can't simply copy the exe out, even if you did run windeployqt (because windeployqt does not change the exe).

                Cheers.

                A 1 Reply Last reply
                2
                • Paul ColbyP Paul Colby

                  Hi @Aditya1309,

                  It sounds like you're a little confused about the concepts here... specifically how windeploy qt affects the exe (or rather doesn't affect it). Let me see if I can shed some light on the typical process for building a distributable for Windows:

                  1. When you build the application (let's call it MyApp), the build process generates, for example, MyApp.exe - this is not a standalone exe (unless your using Qt with static linking, which is a whole other topic).

                  2. Next, you may use windeployqt to gather all of the dependencies (that it can detect) into the same directory as the MyApp.exe. This is still not a standalone app - its an exe, along with a set of dll's, that must (in most cases) stay together.

                  3. Finally, if you wish, you can generate an installer application, for example InstallMyApp.exe (or InstallMyApp.msi). This is a standalone (installer) app - or at least it should be if your installer framework is any good.

                  The installer produced in step 3 would typically "install" (ie copy) the MyApp.exe app from step 1, along with all of the dependencies from step 2, into some destination folder. But at no point did MyApp.exe become a "standalone" app - you still cannot simply copy it out and use it without the other dll's being present.

                  There are two exceptions:

                  1. if the dependent dll's are present elsewhere on the target machine, then sometimes copying just the MyApp.exe will work - this often happens on development machines, then fails for example when distributed to end users. Don't rely on this.
                  2. it is possible to statically link Qt - the default Qt installation does not support this (at least not the last time I checked), so it requires you to build Qt from source, with static-linking enabled. (Note, this has important licensing considerations!) However, if you do this, then you should not need to use windeployqt at all (or more specifically, windeployqt would only pick up on non-Qt dependencies that weren't also statically linked).

                  I hope that gives you a bit of a better idea of what's going on, and why you can't simply copy the exe out, even if you did run windeployqt (because windeployqt does not change the exe).

                  Cheers.

                  A Offline
                  A Offline
                  Aditya1309
                  wrote on last edited by
                  #8

                  @Paul-Colby Thanks for the info.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved