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. Problem in running the exe file
Qt 6.11 is out! See what's new in the release blog

Problem in running the exe file

Scheduled Pinned Locked Moved General and Desktop
13 Posts 6 Posters 14.4k Views 1 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
    koahnig
    wrote on last edited by
    #2

    Do you have the path with the dlls set in your environment?

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jk_mk
      wrote on last edited by
      #3

      I have set E:\Qt\4.7.3 in my enviromental variables with name QTDIR

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #4

        You should set the bin directory also in your path variable. Then it should work.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #5

          All dependencies (DLLs), including the Qt libraries, have to be placed in one of these "locations":http://goo.gl/FNXv9

          bq. * The directory where the executable module for the current process is located.

          • The current directory.
          • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
          • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
          • The directories listed in the PATH environment variable.
          1 Reply Last reply
          0
          • J Offline
            J Offline
            jk_mk
            wrote on last edited by
            #6

            Well I have run my application in release mode and I have set the bin directory in my path variable. So I have created the exe file, and I can run it without using the vs2010. But when I am trying to run the exe in an other machine I cannot open it and I get an error saying that it cannot find the QtCored4.dll.I must say that in this second machine I have already set the bin directory in my path variable.So when I create a project in this machine I can run the exe file properly. Do you know what is going wrong? And how I could run the created exe in other machines without having problems?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Alexandr Ekimov
              wrote on last edited by
              #7

              bq. run my application in release mode

              bq. it cannot find the QtCored4.dll

              One of these statements is incorrect.

              Ekimov Alexander,
              http://www.ekimoff.com

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jk_mk
                wrote on last edited by
                #8

                Well I have managed to run my exe file by copying all the dll's files in the same directory with exe file. So I managed to run the exe in two different machines, which both have the same version of Qt. I want to know, if I tried to run the exe in a PC which will not have installed the Qt, then could I take my results?Or is it neccesery to run the exe on pc's with Qt installed?

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dbzhang800
                  wrote on last edited by
                  #9

                  [quote author="jk_mk" date="1309682805"]Well I have managed to run my exe file by copying all the dll's files in the same directory with exe file. So I managed to run the exe in two different machines, which both have the same version of Qt. I want to know, if I tried to run the exe in a PC which will not have installed the Qt, then could I take my results?Or is it neccesery to run the exe on pc's with Qt installed?

                  [/quote]

                  http://doc.qt.nokia.com/4.7/deployment-windows.html

                  1 Reply Last reply
                  0
                  • ZlatomirZ Offline
                    ZlatomirZ Offline
                    Zlatomir
                    wrote on last edited by
                    #10

                    To distribute the application on a system without Qt installed (or without Qt dlls in path) you copy the .dll files into the same folder as the .exe file, there is one dll for each Qt module you used into your project (ex: QtCore4.dll, QtGui4.dll, etc) and you also need the run-time dlls of the compiler you use (in your case you need the vs2010 redist to be installed)

                    But you messed up something (see Alexandr's post) because if you built (and copied) the "release" .exe then it shouldn't ask for the QtCore d 4.dll (this one is the debug built dll) and you will need the QtCore4.dll for release .exe (without that 'd' in the name) - just be careful what you build and what you copy and you should be fine.

                    https://forum.qt.io/category/41/romanian

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #11

                      The places for dlls have been nicely summarized by this post ( see also above ).

                      [quote author="Lukas Geyer" date="1309625643"]All dependencies (DLLs), including the Qt libraries, have to be placed in one of these "locations":http://goo.gl/FNXv9

                      bq. * The directory where the executable module for the current process is located.

                      • The current directory.
                      • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
                      • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
                      • The directories listed in the PATH environment variable.[/quote]

                      Certainly you can copy every time the exe and the dll to the desired directories. But with vs2010 you may want to create a "Setup and Deployment" project. If you add a project in vs you should have such a possibility under other projects.

                      As Zlatomir pointed out, you are using a debug dll with a release compilation? That should not happen.

                      One last important thing for distribution of your project's results are the license conditions.

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        jk_mk
                        wrote on last edited by
                        #12

                        Well I fixed the problem of QtCore4.dll, as I build my application in release mode from scratch.
                        I have created the exe file in vs2010 (windows7 64 bit) and now I am trying to run it in a pc (windowsXP 32 bit) with vs2008.As I can understand it is not necessery to install Qt in the second pc. I copy all the bin folder including the dll's and the exe file in the second pc. I have installed vs2010 redist in the second pc.But when I double click on the exe I get a message saying that msvcp100.dll is missing from my pc. I downloaded and copy this dll in the folder, and I have tried to run again the exe. But now I get a message saying that msvcpr100.dll is missing from my pc. I download this dll again but again I cannot run the exe.
                        Am I missing something?

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #13

                          You are missing the VS2010 specific dlls. That is why I was already adding:
                          [quote author="koahnig" date="1309689725"]
                          Certainly you can copy every time the exe and the dll to the desired directories. But with vs2010 you may want to create a "Setup and Deployment" project. If you add a project in vs you should have such a possibility under other projects.
                          [/quote]

                          The only way I know to handle this is the "Setup and Deployment" project. You need to consult the microsoft help text for this.

                          I was once doing it for VS2005. Under VS2005 you somehow detect all the dlls you need. For VS2010 you need to find your way through. I doubt that is close to VS2005 procedure.

                          Vote the answer(s) that helped you to solve your issue(s)

                          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