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. Setting up environment, deployment.

Setting up environment, deployment.

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 4 Posters 1.5k 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by SPlatten
    #1

    I have been building and running the project I'm working on entirely in Qt Creator, I've sent the application to a colleague and he is having difficultly running from the command line.

    I created a deployment folder using windeployqt, and whilst this contains folders and dll's there is nothing in this folder to add set-up of a target system.

    What is required to make the dll's and drivers in this produced folder useful and visible to the application when run from the command line?

    Kind Regards,
    Sy

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

      Hi,

      There's nothing special to do as on Windows the application is the first folder searched for libraries.

      What exactly happens to your tester ?

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

      SPlattenS 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        There's nothing special to do as on Windows the application is the first folder searched for libraries.

        What exactly happens to your tester ?

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #3

        @SGaist , thank you for the reply, I'm trying this on the laptop I'm using to develop on which has a full installation of Qt Creator.

        On Windows version 10.0.19041.1052, with Qt 5.9.2, I open a command prompt and go to the folder where the executable was built:

        C:\Users\simon.platten\Documents\vehicle-training-setup-application\build-training-server-application-Desktop_Qt_5_9_2_MSVC2015_32bit-Debug\debug
        

        I then try to launch the executable:

        trngServer QMYSQL localhost training trainer Password
        

        The result is 4 dialogs displayed one after the other:
        01280d59-e5df-4124-b191-8801a868985e-image.png
        601fb55a-25a5-4725-af9e-e6f5b3db945c-image.png
        e20aa259-c33d-4361-a752-29309dfb9c5c-image.png
        dbfb8b89-1477-4031-9be4-623a5a0306a0-image.png

        Kind Regards,
        Sy

        KroMignonK 1 Reply Last reply
        0
        • SPlattenS SPlatten

          @SGaist , thank you for the reply, I'm trying this on the laptop I'm using to develop on which has a full installation of Qt Creator.

          On Windows version 10.0.19041.1052, with Qt 5.9.2, I open a command prompt and go to the folder where the executable was built:

          C:\Users\simon.platten\Documents\vehicle-training-setup-application\build-training-server-application-Desktop_Qt_5_9_2_MSVC2015_32bit-Debug\debug
          

          I then try to launch the executable:

          trngServer QMYSQL localhost training trainer Password
          

          The result is 4 dialogs displayed one after the other:
          01280d59-e5df-4124-b191-8801a868985e-image.png
          601fb55a-25a5-4725-af9e-e6f5b3db945c-image.png
          e20aa259-c33d-4361-a752-29309dfb9c5c-image.png
          dbfb8b89-1477-4031-9be4-623a5a0306a0-image.png

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by KroMignon
          #4

          @SPlatten said in Setting up environment, deployment.:

          On Windows version 10.0.19041.1052, with Qt 5.9.2, I open a command prompt and go to the folder where the executable was built:

          This cannot work, you have to use windeployqt.exe to copy all shared libraries locally.

          cf https://doc.qt.io/qt-5/windows-deployment.html or https://wiki.qt.io/Deploy_an_Application_on_Windows

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          SPlattenS 1 Reply Last reply
          1
          • KroMignonK KroMignon

            @SPlatten said in Setting up environment, deployment.:

            On Windows version 10.0.19041.1052, with Qt 5.9.2, I open a command prompt and go to the folder where the executable was built:

            This cannot work, you have to use windeployqt.exe to copy all shared libraries locally.

            cf https://doc.qt.io/qt-5/windows-deployment.html or https://wiki.qt.io/Deploy_an_Application_on_Windows

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #5

            @KroMignon , sorry, the windeployqt is only used to create the install folder for systems that are not the development laptop, it was not used on this laptop.

            However this is the issue I have, I can run the executable from Qt Creator but not in a command prompt.

            Kind Regards,
            Sy

            KroMignonK J.HilkJ 2 Replies Last reply
            0
            • SPlattenS SPlatten

              @KroMignon , sorry, the windeployqt is only used to create the install folder for systems that are not the development laptop, it was not used on this laptop.

              However this is the issue I have, I can run the executable from Qt Creator but not in a command prompt.

              KroMignonK Offline
              KroMignonK Offline
              KroMignon
              wrote on last edited by KroMignon
              #6

              @SPlatten said in Setting up environment, deployment.:

              However this is the issue I have, I can run the executable from Qt Creator but not in a command prompt.

              This is normal, Qt Creator will setup environment variable to point to shared libraries before starting application.
              When starting from command prompt, you have to do it yourself.

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              1 Reply Last reply
              2
              • SPlattenS SPlatten

                @KroMignon , sorry, the windeployqt is only used to create the install folder for systems that are not the development laptop, it was not used on this laptop.

                However this is the issue I have, I can run the executable from Qt Creator but not in a command prompt.

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @SPlatten if you don't want to provide the dlls locally, than you have to add them to the path, preferably not the global one, but the local one in the command prompt

                Take a look into the project settings in QtCreator check the build environment, check the path and compare it to the one set in the cmd prompt and append accordingly


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                SPlattenS 1 Reply Last reply
                1
                • J.HilkJ J.Hilk

                  @SPlatten if you don't want to provide the dlls locally, than you have to add them to the path, preferably not the global one, but the local one in the command prompt

                  Take a look into the project settings in QtCreator check the build environment, check the path and compare it to the one set in the cmd prompt and append accordingly

                  SPlattenS Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #8

                  @J-Hilk, thank you, I thought that Qt Creator would have done that as part of the installation, obviously not.

                  Kind Regards,
                  Sy

                  KroMignonK 1 Reply Last reply
                  0
                  • SPlattenS SPlatten

                    @J-Hilk, thank you, I thought that Qt Creator would have done that as part of the installation, obviously not.

                    KroMignonK Offline
                    KroMignonK Offline
                    KroMignon
                    wrote on last edited by KroMignon
                    #9

                    @SPlatten said in Setting up environment, deployment.:

                    thank you, I thought that Qt Creator would have done that as part of the installation, obviously not.

                    There is not reason to change WINDOWS path.
                    Qt Creator will only update WINDOWS environment settings before starting the application. This is enough.

                    By the way, why do you want to launch it from the build path and don't start it from QtCreator?

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    SPlattenS 1 Reply Last reply
                    0
                    • KroMignonK KroMignon

                      @SPlatten said in Setting up environment, deployment.:

                      thank you, I thought that Qt Creator would have done that as part of the installation, obviously not.

                      There is not reason to change WINDOWS path.
                      Qt Creator will only update WINDOWS environment settings before starting the application. This is enough.

                      By the way, why do you want to launch it from the build path and don't start it from QtCreator?

                      SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by
                      #10

                      @KroMignon , for testing purpose's, I'm sent the application to someone else to test and I wanted to be sure it would work locally outside of Qt Creator.

                      Kind Regards,
                      Sy

                      J.HilkJ KroMignonK 2 Replies Last reply
                      0
                      • SPlattenS SPlatten

                        @KroMignon , for testing purpose's, I'm sent the application to someone else to test and I wanted to be sure it would work locally outside of Qt Creator.

                        J.HilkJ Offline
                        J.HilkJ Offline
                        J.Hilk
                        Moderators
                        wrote on last edited by
                        #11

                        @SPlatten said in Setting up environment, deployment.:

                        @KroMignon , for testing purpose's, I'm sent the application to someone else to test and I wanted to be sure it would work locally outside of Qt Creator.

                        than use the deployment tool, thats what it is for :D

                        anyway inside your bin folder of your qt installation , there's a qtenv.bat if you execute that inside your cmd prompt, it should set up the environment correctly (locally)


                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                        Q: What's that?
                        A: It's blue light.
                        Q: What does it do?
                        A: It turns blue.

                        SPlattenS 1 Reply Last reply
                        1
                        • SPlattenS SPlatten

                          @KroMignon , for testing purpose's, I'm sent the application to someone else to test and I wanted to be sure it would work locally outside of Qt Creator.

                          KroMignonK Offline
                          KroMignonK Offline
                          KroMignon
                          wrote on last edited by KroMignon
                          #12

                          @SPlatten said in Setting up environment, deployment.:

                          I wanted to be sure it would work locally outside of Qt Creator.

                          So you should try out the deployment result, not the build result ;)

                          You need to use windeployqt.exe or CQtDeployer.

                          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                          1 Reply Last reply
                          2
                          • J.HilkJ J.Hilk

                            @SPlatten said in Setting up environment, deployment.:

                            @KroMignon , for testing purpose's, I'm sent the application to someone else to test and I wanted to be sure it would work locally outside of Qt Creator.

                            than use the deployment tool, thats what it is for :D

                            anyway inside your bin folder of your qt installation , there's a qtenv.bat if you execute that inside your cmd prompt, it should set up the environment correctly (locally)

                            SPlattenS Offline
                            SPlattenS Offline
                            SPlatten
                            wrote on last edited by
                            #13

                            @J-Hilk , now your confusing me, as I said I'm trying to run it locally, the deployment tool as I've been told is not for local use.

                            Kind Regards,
                            Sy

                            J.HilkJ KroMignonK 2 Replies Last reply
                            0
                            • SPlattenS SPlatten

                              @J-Hilk , now your confusing me, as I said I'm trying to run it locally, the deployment tool as I've been told is not for local use.

                              J.HilkJ Offline
                              J.HilkJ Offline
                              J.Hilk
                              Moderators
                              wrote on last edited by
                              #14

                              @SPlatten the deployment tool is for running the application as a standalone application outside of QtCreator.

                              My (locally) was referring to that instance of the command line tool


                              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                              Q: What's that?
                              A: It's blue light.
                              Q: What does it do?
                              A: It turns blue.

                              SPlattenS 1 Reply Last reply
                              0
                              • J.HilkJ J.Hilk

                                @SPlatten the deployment tool is for running the application as a standalone application outside of QtCreator.

                                My (locally) was referring to that instance of the command line tool

                                SPlattenS Offline
                                SPlattenS Offline
                                SPlatten
                                wrote on last edited by
                                #15

                                @J-Hilk , IMHO there seems to be quite a few things that could be simplified and improved in what is now quite a mature product. There is so much outside of the IDE that has to be done manually.

                                Kind Regards,
                                Sy

                                1 Reply Last reply
                                0
                                • SPlattenS SPlatten

                                  @J-Hilk , now your confusing me, as I said I'm trying to run it locally, the deployment tool as I've been told is not for local use.

                                  KroMignonK Offline
                                  KroMignonK Offline
                                  KroMignon
                                  wrote on last edited by
                                  #16

                                  @SPlatten said in Setting up environment, deployment.:

                                  now your confusing me, as I said I'm trying to run it locally, the deployment tool as I've been told is not for local use.

                                  I try to be more explicit:

                                  • Qt libraries (and also MSVC libraries) are shared libraries. On Windows they need to be on application directory or accessible through PATH settings
                                  • Qt also uses plugin (like graphic, sound, network, etc.) which needs to be locally or accessible via QT_PLUGIN_PATH

                                  Because you could have many Qt Version installed on you development machine, it don't make sense to set add Qt libraires path into PATH environment. This will be done by QtCreator before starting application.

                                  If you want to deploy the application, you have to used a deployment tool which will copy the required DLL.

                                  It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                  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