简体   繁体   中英

QT Application doesn't work on Windows explorer?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM