7

I built a Qt 5 application using Qt Creator on Windows 7 64 bit (using msvc 2010). The application runs perfectly on my computer but it won't work on other computers.

I copied all the .dlls which were shown as missing in Dependency Walker into the program folder and there is no error, but the application just won't run.

I've tested it on Windows XP and Windows 7 64 and 32 bit.
What can I do in order to find out what's wrong?

UPDATE: i installed Qt 4.8.4 (vs 2008) and msvc 2008 express and i compiled it and it's runs on other computers, with the .dlls of Qt4. maybe someone know what the problem with Qt5...

avi software
  • 145
  • 1
  • 3
  • 11
  • Try running the executable from the command prompt so that you can read the error message, and adding it to your question. [This may help](http://www.wikihow.com/Run-a-Program-on-Command-Prompt) – Anti Earth Jan 17 '13 at 00:05
  • @AntiEarth that give me blank line. no error message... – avi software Jan 17 '13 at 00:22
  • If your app is in Debug mode, than it should not work on other computer. Even with needed dlls. If so - make a Release variant – borisbn Jan 17 '13 at 08:17
  • @borisbn my app is in Release mode... and nothing.. – avi software Jan 17 '13 at 09:41
  • @avisoftware what ABI did you choose in `Tools/Options/Build&Run/Tool Chains` menu ? – borisbn Jan 17 '13 at 10:31
  • @avisoftware On your computer have you tried running it by double clicking on the exe from explorer, or do you only run it from Qt Creator? – sashoalm Jan 17 '13 at 10:33
  • @borisbn Microsoft Visual C++ Compiler 10.0 (x86) it's the default. – avi software Jan 17 '13 at 10:54
  • @satuon yes. it's run good with the .dlls in the folder.... – avi software Jan 17 '13 at 10:56
  • Di you build it with the option `release`? – prehistoricpenguin Jan 17 '13 at 11:39
  • 4
    Make sure you copy necessary plugins as well, maybe you have this problem: http://stackoverflow.com/questions/14291078/qt-application-failed-to-load-platform-plugin-windows-available-platforms-ar/14291223#14291223 – Eugene Jan 17 '13 at 22:56
  • possible duplicate of [Application deployed with QT5 libraries does not start on Windows 7](http://stackoverflow.com/questions/14144075/application-deployed-with-qt5-libraries-does-not-start-on-windows-7) – sean e Jan 20 '13 at 19:08
  • depends will not identify dependencies on Qt plugins since they are dynamically loaded - the problem is most likely the windows plugin per the other question that I marked this as a duplicate of. – sean e Jan 20 '13 at 19:10

5 Answers5

6

I had the same problem.

You need to include the "platform" directory containing qwindows.dll and qminimal.dll in your executable directory. You can find the directory under the "plugins" folder.

If you don't add this, your application will appear to load and then exit with return code 0. Dependency walker cant help you because the DLLs are delay-loaded.

3

I had the same problem - I'd added all the DLLs reported by Dependency Walker, but my program exited immediately with no error message when run.

I added libEGL.dll to the program directory and it now runs normally.

I'm guessing that libEGL.dll is loaded dynamically by one of the other DLLs - probably libGLESv2.dll, on the basis that of all the known dependencies it has the most similar name (!) - and that dynamic loading is not something that Dependency Walker can detect.

Paul
  • 4,160
  • 3
  • 30
  • 56
  • worked for me! Thank you so much!!! I had the same problem. For me including the 'platform' folder and adding mingwm10.dll wasn't necessary. I just added all the DLL files that the error message when I click my .exe file keeps giving me, then the final step is to add libEGL.dll, and then it just works! – hexicle Jun 22 '13 at 22:41
1

I experienced the same issue as well and learned that MinGW GCC 4.7 is not compatible with Qt 5.0 and above from this this post. I took the same approach as you did and switched over to Qt Creator 4.8 which worked.

Random_NPC
  • 61
  • 2
  • 7
0

I also had the same problem and tried with both DLL missing messages & Dependency Walker, and it didn’t helped me or I don’t know whether I used it properly. The below method helped me to solve (For the given scenario) it. This method will work to some minimum cases.

Scenario

  1. QT Creator 3.3.2
  2. QT 5.4.1 (MSVC 2010, 32 bit), Windows 8.1 OS
  3. Used no dynamic loading of dll's
  4. Used no third party dll's
  5. It’s a QTWidget application.

Method (Tried for both kit MinGW 32 bit & MSVC2012 OpenGL 32 bit)

  1. Get the release exe after building the application. Copy and paste to another folder where we want (Assume as Z:\abc)
  2. Go to the Qt kit (MinGW OR MSVC) installed folder (In my case : Z:\Qt\5.4\mingw491_32 (or) Z:\Qt\5.4\msvc2012_opengl)
  3. Search for *.dll
  4. Copy all the DLL and paste it to the exe placed folder. That is (z:\abc)
  5. Run the application (In my case it started properly).
  6. While running the application, delete all the copied DLL file's.

    6.1) While deleting, windows will show prompt for the DLL files which are being used by the application (File in use), as those DLL's were loaded initially. Leave those files as it is.

    6.2) And other DLL files will get deleted as we requested.

  7. Close the application and reopen it (In my case it started properly).
  8. So here we got the needed DLL's

This is not a proper way, but it may help in some cases.

Note

While copying all the DLL's, when getting file already exist message, keep both the files in different names as system decide. If the application wont runs, then we can try with these renamed files.

Jeet
  • 1,006
  • 1
  • 14
  • 25
0

I reckon it must be some DLL that you need to put in the same directory as your executable, or maybe even in a directory that's in your PATH. Either way, I'm using Qt5 as well, and I run into the same problem as you if I don't put these in the same directory as my exe file:

  • vcruntime140[d].dll (an MSVC library)
  • ucrtbase[d].dll (another MSVC library -- I am using MSVC/Visual C++)
  • Qt5Widgets[d].dll (Qt 5 library)
  • Qt5Svg[d].dll (another Qt 5 lib)
  • Qt5PrintSupport[d].dll (another Qt 5 lib)
  • Qt5Gui[d].dll (you guessed it)
  • Qt5Core[d].dll (yup)
  • msvcp150[d].dll (I believe another Microsoft redistributable)

Of course you might not be using any of those Qt libraries that I'm using, in which case you wouldn't need them. Further, you might have a different toolchain that calls for different DLLs, but the idea I think is the same, and besides maybe you have an identical setup as mine.

I appended a [d] to the end of each of those libs, because for debug builds they have a d at the end, but for release builds they do not. That part may or may not be the same on your machine. I believe it is a setting or a set thereof.

23r0c001
  • 151
  • 1
  • 6