简体   繁体   English

QT应用程序在Windows资源管理器上不起作用?

[英]QT Application doesn't work on Windows explorer?

How do I execute the QT application on Windows explorer. 如何在Windows资源管理器中执行QT应用程序。 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. 我只是下载了它,所以当我通过QT创建器运行应用程序时,我仍然对QT还是陌生的,但是可以正常运行,但是当我在Windows资源管理器中执行它时(\\ QT \\ testingGUI-build-desktop-Qt_4_8_0__4_8_0__Release \\ release <-在此文件夹中)它不起作用,没有错误,没有消息。

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? 尽管您可以通过QT创建器运行您的应用程序,但如果相关库(.dll)文件未驻留在应用程序(.exe)所在的文件夹中,则可能无法在Windows资源管理器(或QT创建器外部)上运行该应用程序因此,您要做的就是将那些相关的library.dll文件复制并粘贴到应用程序所在的文件夹中。但是您如何确定需要哪些库文件呢? to find out what library files are linked with the application 找出哪些库文件与应用程序链接

http://www.dependencywalker.com/ 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. 然后转到QT库存储库Qt \\ 4.8.0 \\ bin(如果您不记得确切的位置,请在Windows资源管理器上搜索),这是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) 现在示例QtGui4.dll->释放.dll(这是相对较小的)QtGui * d * 4.d​​ll->调试.dll(这是相对较大的,因此请勿使用此库文件来部署应用程序)

don't forget the d cause it indicates that library file is used in debugging stage. 不要忘记d原因,因为它表明在调试阶段使用了库文件。 so you don't need to use it for application which was already released. 因此您无需将其用于已发布的应用程序。

The Qt DLLs are probably not in your PATH. Qt DLL可能不在您的PATH中。 You may also simply copy the required Qt DLLs to your release directory. 您也可以简单地将所需的Qt DLL复制到发行目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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