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. How to deploy Qt C++ Application on Windows when i used Visual Studio to create my application

How to deploy Qt C++ Application on Windows when i used Visual Studio to create my application

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++visual studioqt 5.4qtwidgets
6 Posts 5 Posters 3.9k Views
  • 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.
  • L Offline
    L Offline
    learnist
    wrote on last edited by learnist
    #1

    I just Build my Project and now when i click the executable file (.exe), i gives errors that some .dll files are missing, so i referred this page https://doc.qt.io/qt-5/windows-deployment.html which says that i can use Windows Deployment Tool, which is found in QTDIR/bin/windeployqt folder directory, but when i go to the path in the image c\Qt\5.14.1```

    d3995349-0bcd-4533-a25a-e3565cfbebed-image.png

    i see all of these folders and all of them have bin folders and all bin folders have the windeployqt.exe , so my question is which one do i use, since i used Visual Studio 2019. and from the link documentation,

    The simplest way to use windeployqt is to add the bin directory of your Qt
    installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:
      windeployqt <path-to-app-binary>
    

    i understood that Step-1 > i need to open command prompt in administrator role.

    Step-2 > i need to type ```
    set PATH = C\Qt\5.14.1\ anyone\which one of all those folders.

    Step-3 > i need to type windeployqt
    

    C:\projects\GAF_Updated\GAF\x64\Release\project_name.exe

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Use the version that matches the Qt version you used to build your application.

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

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Use the version that matches the Qt version you used to build your application.

        L Offline
        L Offline
        learnist
        wrote on last edited by
        #3

        @SGaist Thanks for the suggestion, i went into visual studio , Extensions->QT VS Tools-> Qt options and this thing shows up ,where i got to know the version i am using
        72f7671c-b31d-4161-bd7c-fb0390ea47b4-image.png

        so, i opened command prompt and did this 2.JPG

        so , in my applications .exe folder, i see some more .dll files being added, but still i get the same errors
        missing Qt5Widgets.dll,Qt5Core.dll,Qt5Gui.dll, i have all of those but the name ends with d, should i try renaming them ?
        f4edf384-c93c-4048-b130-dc74c22c6135-image.png

        JonBJ 1 Reply Last reply
        0
        • L learnist

          @SGaist Thanks for the suggestion, i went into visual studio , Extensions->QT VS Tools-> Qt options and this thing shows up ,where i got to know the version i am using
          72f7671c-b31d-4161-bd7c-fb0390ea47b4-image.png

          so, i opened command prompt and did this 2.JPG

          so , in my applications .exe folder, i see some more .dll files being added, but still i get the same errors
          missing Qt5Widgets.dll,Qt5Core.dll,Qt5Gui.dll, i have all of those but the name ends with d, should i try renaming them ?
          f4edf384-c93c-4048-b130-dc74c22c6135-image.png

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @learnist
          In that "Release" directory I see the Qt5...dll names all end in the letter d (just before the .dll). That means they are compiled for debug. And the GAF...pdb files also come from debug compilation. The error message shows it is looking instead for Qt5Widget.dll, which is not compiled for debug.

          You need to sort out why this is. You should not be deploying debug builds, only release ones (unless you know what you are doing).

          1 Reply Last reply
          2
          • M Offline
            M Offline
            Moter12
            wrote on last edited by Moter12
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • B Offline
              B Offline
              Bonnie
              wrote on last edited by Bonnie
              #6
              1. To solve the VCINSTALLDIR problem, start the command prompt from your start menu -> Visual Studio 2017 -> x64 Native Tools Command Prompt (be sure not the ones with x86)
                Then call :
                set PATH=C:\Qt\5.14.1\msvc2017_64\bin;%PATH%
                to make both vc and qt dirs in your PATH.
              2. To force deploying the release binaries, add --release after windeployqt.
              1 Reply Last reply
              2

              • Login

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