Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't deploy .exe on Windows
Forum Updated to NodeBB v4.3 + New Features

Can't deploy .exe on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 755 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.
  • K Offline
    K Offline
    kitfox
    wrote on last edited by kitfox
    #1

    I'm trying to figure out how to create an executable that I can deploy to Windows machines that do not have Qt installed. As a test, I created a new default Qt Widget project. I then compiled release versions for both mingw-32 and MSVC2017 toolkits. I then copied the final .exe file into an empty directory (I used different empty directories for both binaries) and executed the command:

    C:\Qt\5.12.3\mingw73_32\bin\windeployqt.exe .
    

    This copied a lot of DLLs into my deployment directory. However, I am still unable to run my executables. The mingw_32 complains that it cannot find libgcc_s_dw2-1.dll and the MSVC2017 just says that it is unable to start correctly.

    If I add C:\Qt\5.12.3\mingw73_32\bin to my PATH then the mingw_32 release will run correctly, but obviously I cannot expect my users to have this on their system.

    How can I create a release of this test app?

    Pablo J. RoginaP 1 Reply Last reply
    0
    • K kitfox

      I'm trying to figure out how to create an executable that I can deploy to Windows machines that do not have Qt installed. As a test, I created a new default Qt Widget project. I then compiled release versions for both mingw-32 and MSVC2017 toolkits. I then copied the final .exe file into an empty directory (I used different empty directories for both binaries) and executed the command:

      C:\Qt\5.12.3\mingw73_32\bin\windeployqt.exe .
      

      This copied a lot of DLLs into my deployment directory. However, I am still unable to run my executables. The mingw_32 complains that it cannot find libgcc_s_dw2-1.dll and the MSVC2017 just says that it is unable to start correctly.

      If I add C:\Qt\5.12.3\mingw73_32\bin to my PATH then the mingw_32 release will run correctly, but obviously I cannot expect my users to have this on their system.

      How can I create a release of this test app?

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @kitfox said in Can't deploy .exe on Windows:

      I cannot expect my users to have this on their system

      You need to deploy libgcc_s_dw2-1.dll to the machines you intend to run your mingw built Qt app

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      K 1 Reply Last reply
      3
      • Pablo J. RoginaP Pablo J. Rogina

        @kitfox said in Can't deploy .exe on Windows:

        I cannot expect my users to have this on their system

        You need to deploy libgcc_s_dw2-1.dll to the machines you intend to run your mingw built Qt app

        K Offline
        K Offline
        kitfox
        wrote on last edited by
        #3

        @Pablo-J.-Rogina Trouble is, if I include libgcc_s_dw2-1.dll (and libwinpthread-1.dll which it depends on), I get a bunch of errors about procedure entry points not being found. It also doesn't explain why the MSVC2017 release doesn't work.

        Pablo J. RoginaP 1 Reply Last reply
        0
        • K kitfox

          @Pablo-J.-Rogina Trouble is, if I include libgcc_s_dw2-1.dll (and libwinpthread-1.dll which it depends on), I get a bunch of errors about procedure entry points not being found. It also doesn't explain why the MSVC2017 release doesn't work.

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by Pablo J. Rogina
          #4

          @kitfox beyond deploying those .dll files you mentioned, perhaps you also need to set the PATH properly for (system) files already deployed in the machines that somehow are not being found.

          Dependency Walker tool is your friend in cases like this.

          I cannot speak regarding MSVC sorry

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          K 1 Reply Last reply
          2
          • Pablo J. RoginaP Pablo J. Rogina

            @kitfox beyond deploying those .dll files you mentioned, perhaps you also need to set the PATH properly for (system) files already deployed in the machines that somehow are not being found.

            Dependency Walker tool is your friend in cases like this.

            I cannot speak regarding MSVC sorry

            K Offline
            K Offline
            kitfox
            wrote on last edited by
            #5

            @Pablo-J.-Rogina Looks like I need to add libstdc++-6.dll to my deploy directory as well. Seems odd the windeployqt tool would skip these. It would be nice if I could get this working for MSVC as well.

            mrjjM 1 Reply Last reply
            0
            • K kitfox

              @Pablo-J.-Rogina Looks like I need to add libstdc++-6.dll to my deploy directory as well. Seems odd the windeployqt tool would skip these. It would be nice if I could get this working for MSVC as well.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @kitfox
              Hi
              I noticed a few times thats the compilers runtime dlls are not added.
              For mingw its libgcc_s_dw2-1.dll and libwinpthread-1.dll and libstdc++-6.dll

              Often the visual studio run times DLLS are included in Windows, but for Windows 7
              seems not to default have them and one can install
              Microsoft Visual C++ 2017(5) Redistributable to get them

              1 Reply Last reply
              1

              • Login

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