0

How do I execute the QT application on Windows explorer. I just downloaded it so I am still new to QT when I run the application through the QT creator it works fine but when I execute it on windows explorer (\QT\testingGUI-build-desktop-Qt_4_8_0__4_8_0__Release\release <-in this folder) it doesn't work ,no error, no message nothing.

okay I figured out how to solve this.

Answer

If anyone got this issue follow these steps ,you can solve your issue if it's related missing libraries.

the process of releasing an application known as deploying. though you can run your application through the QT creator it may not possible to run it on windows explorer (or outside of QT creator) if the relevant library(.dll) files are not resided inside the folder where your application in(.exe) so all you have to do is copy and paste those relevant library(.dll) files to the folder where your application in. but how do you figure out what library files are needed? to find out what library files are linked with the application

http://www.dependencywalker.com/

use this software, run your application and find out is there any error message( it indicates in yellow /red colour) the missing library files are shown in the second window (bottom) there might be many but not all library files are needed cause I suppose it's enough to copy -> paste the main library.

then go to the QT library repository Qt\4.8.0\bin (search on windows explorer if you don't remember the exact place) this is where all library files are stored by the QT. copy all relevant library files and paste to the directory where your application in. that's all. make sure you don't copy paste the library files in which are needed for debugging.

now example QtGui4.dll - > releasing .dll (this is relatively small) QtGui*d*4.dll -> debugging .dll (this is relatively big so don't use this library file for deploying your application)

don't forget the d cause it indicates that library file is used in debugging stage. so you don't need to use it for application which was already released.

user1120193
  • 252
  • 3
  • 11

1 Answers1

3

The Qt DLLs are probably not in your PATH. You may also simply copy the required Qt DLLs to your release directory.

sschuberth
  • 28,386
  • 6
  • 101
  • 146
  • Isn't there an automated process to do this through QT Creator? – user1120193 Jan 14 '12 at 11:09
  • 1
    Does it not say 'such and such' dll not found when that is the problem though? Afaik, it does and the OP said that there was no error message, that's why I was confused. – batbrat Jan 14 '12 at 11:11
  • 1
    well it doesn't say anything. I can see it runs on task manager but it disappears within couple of seconds. all I can do run it through the QT creator. – user1120193 Jan 14 '12 at 11:16
  • thanks what you said is correct but your question is not enough to solve the issue. – user1120193 Jan 14 '12 at 11:48
  • AFAIK there is no automated process to do this in QtCreator, but you could of course create a deployment build step yourself. Also see [How to deploy my application using Qt-Creator?](http://stackoverflow.com/questions/1947229/how-to-deploy-my-application-using-qt-creator) and [How can i add custom build steps in Qt-Creator?](http://stackoverflow.com/questions/4438919/how-can-i-add-custom-build-steps-in-qt-creator) – sschuberth Jan 14 '12 at 17:14