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 9 Oct 2017, 09:02 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
    • Y Offline
      Y Offline
      yuvaram
      wrote on 9 Oct 2017, 09:53 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 9 Oct 2017, 09:54
      0
      • Y yuvaram
        9 Oct 2017, 09:53

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

        K Offline
        K Offline
        Kushan
        wrote on 9 Oct 2017, 09:54 last edited by
        #3

        @yuvaram create an executeble

        Y 1 Reply Last reply 9 Oct 2017, 09:56
        0
        • K Kushan
          9 Oct 2017, 09:54

          @yuvaram create an executeble

          Y Offline
          Y Offline
          yuvaram
          wrote on 9 Oct 2017, 09:56 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 9 Oct 2017, 10:01
          0
          • Y yuvaram
            9 Oct 2017, 09:56

            @Kushan
            This link should help you

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

            K Offline
            K Offline
            Kushan
            wrote on 9 Oct 2017, 10:01 last edited by
            #5

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

            Y R 2 Replies Last reply 9 Oct 2017, 10:17
            0
            • K Kushan
              9 Oct 2017, 10:01

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

              Y Offline
              Y Offline
              yuvaram
              wrote on 9 Oct 2017, 10:17 last edited by yuvaram 10 Sept 2017, 10:19
              #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 9 Oct 2017, 11:36
              0
              • K Kushan
                9 Oct 2017, 10:01

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

                R Offline
                R Offline
                raven-worx
                Moderators
                wrote on 9 Oct 2017, 11:17 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
                • Y yuvaram
                  9 Oct 2017, 10:17

                  @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 9 Oct 2017, 11:36 last edited by
                  #8

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

                  R Y 2 Replies Last reply 9 Oct 2017, 11:39
                  0
                  • K Kushan
                    9 Oct 2017, 11:36

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

                    R Offline
                    R Offline
                    raven-worx
                    Moderators
                    wrote on 9 Oct 2017, 11:39 last edited by raven-worx 10 Sept 2017, 11:39
                    #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
                      9 Oct 2017, 11:36

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

                      Y Offline
                      Y Offline
                      yuvaram
                      wrote on 9 Oct 2017, 11:55 last edited by
                      #10

                      @Kushan change build type from debug to release

                      Yuvaram Aligeti
                      Embedded Qt Developer
                      : )

                      1 Reply Last reply
                      0

                      1/10

                      9 Oct 2017, 09:02

                      • Login

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