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. Deploying Qt c++ mingw application
Forum Updated to NodeBB v4.3 + New Features

Deploying Qt c++ mingw application

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 4.3k 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
    Kushan
    wrote on last edited by
    #1

    I have created a QT application using Qt creator ide according to Mingw format! when I searched the web there is no proper way to deploy it! How can I achieve this?

    1 Reply Last reply
    0
    • yuvaramY Offline
      yuvaramY Offline
      yuvaram
      wrote on last edited by
      #2

      Hi @Kushan
      Do you want to create executable? or Want to run your application

      Yuvaram Aligeti
      Embedded Qt Developer
      : )

      K 1 Reply Last reply
      0
      • yuvaramY yuvaram

        Hi @Kushan
        Do you want to create executable? or Want to run your application

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

        @yuvaram create an executeble

        yuvaramY 1 Reply Last reply
        0
        • K Kushan

          @yuvaram create an executeble

          yuvaramY Offline
          yuvaramY Offline
          yuvaram
          wrote on last edited by
          #4

          @Kushan
          This link should help you

          http://doc.qt.io/qtcreator/creator-build-example-application.html

          Yuvaram Aligeti
          Embedded Qt Developer
          : )

          K 1 Reply Last reply
          0
          • yuvaramY yuvaram

            @Kushan
            This link should help you

            http://doc.qt.io/qtcreator/creator-build-example-application.html

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

            @yuvaram This is just running my app right? not making an executable :(

            yuvaramY raven-worxR 2 Replies Last reply
            0
            • K Kushan

              @yuvaram This is just running my app right? not making an executable :(

              yuvaramY Offline
              yuvaramY Offline
              yuvaram
              wrote on last edited by yuvaram
              #6

              @Kushan
              After build a binary is created "sample.exe", by using RUN option binary can be executed.
              Inorder to make Executable without depending on Qt creator. ( When it uses Qt creator, internally it links all the modules which are specified in .pro file).

              For making executable sample.exe needs all the Qt modules used libraries to run independently.

              Use dependency walker http://www.dependencywalker.com/ which shows list of libraries used in "sample.exe".

              1. By above software - list of libraries used.

              2. Need to add all the libraries in .pro file.
                DESTDIR = "../../"
                dlls.path += $${DESTDIR}
                dlls.files += $$[QT_INSTALL_BINS]/Qt5Core.dll
                dlls.files += $$[QT_INSTALL_BINS]/Qt5Gui.dll
                INSTALLS += dlls

              3. INSTALL argument need to added as command line.
                Projects (within tool bar icon) > add build step (drop down option ) > make >
                In "make arguments:" add "INSTALL"

              4. Back to EDIT option, which shows project. Qmake , rebuild and run.

              This should help to run sample.exe without Qt creator.

              Yuvaram Aligeti
              Embedded Qt Developer
              : )

              K 1 Reply Last reply
              0
              • K Kushan

                @yuvaram This is just running my app right? not making an executable :(

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                @Kushan said in Deploying Qt c++ mingw application:

                @yuvaram This is just running my app right? not making an executable :(

                running an application already needs an executable to run.
                The path where the exe is built is written to the console in QtCreator.

                Test it properly in QtCreator and once you are finished and ready for deployment, the most easiest is to copy the exe to a separate folder and run QTDIR/bin/windeployqt on the exe. This copies all needed dlls beside the exe.

                Further reading.

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                2
                • yuvaramY yuvaram

                  @Kushan
                  After build a binary is created "sample.exe", by using RUN option binary can be executed.
                  Inorder to make Executable without depending on Qt creator. ( When it uses Qt creator, internally it links all the modules which are specified in .pro file).

                  For making executable sample.exe needs all the Qt modules used libraries to run independently.

                  Use dependency walker http://www.dependencywalker.com/ which shows list of libraries used in "sample.exe".

                  1. By above software - list of libraries used.

                  2. Need to add all the libraries in .pro file.
                    DESTDIR = "../../"
                    dlls.path += $${DESTDIR}
                    dlls.files += $$[QT_INSTALL_BINS]/Qt5Core.dll
                    dlls.files += $$[QT_INSTALL_BINS]/Qt5Gui.dll
                    INSTALLS += dlls

                  3. INSTALL argument need to added as command line.
                    Projects (within tool bar icon) > add build step (drop down option ) > make >
                    In "make arguments:" add "INSTALL"

                  4. Back to EDIT option, which shows project. Qmake , rebuild and run.

                  This should help to run sample.exe without Qt creator.

                  K Offline
                  K Offline
                  Kushan
                  wrote on last edited by
                  #8

                  @yuvaram Thanx my release folder is empty only the debug folder has an executable do I have to use it?

                  raven-worxR yuvaramY 2 Replies Last reply
                  0
                  • K Kushan

                    @yuvaram Thanx my release folder is empty only the debug folder has an executable do I have to use it?

                    raven-worxR Offline
                    raven-worxR Offline
                    raven-worx
                    Moderators
                    wrote on last edited by raven-worx
                    #9

                    @Kushan
                    press the button above the "run" and "debug run" button. There you will see how to change between release and debug.

                    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                    If you have a question please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    1
                    • K Kushan

                      @yuvaram Thanx my release folder is empty only the debug folder has an executable do I have to use it?

                      yuvaramY Offline
                      yuvaramY Offline
                      yuvaram
                      wrote on last edited by
                      #10

                      @Kushan change build type from debug to release

                      Yuvaram Aligeti
                      Embedded Qt Developer
                      : )

                      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