Qt5 中发布程序遇到could not find or load the Qt platform plugin "windows"
2017-08-24 14:11
615 查看
1.首先要搞清楚动态链接库还是静态链接
本文只涉及动态链接库,就是编译出来的exe文件加上Qt 的必要dll文件。一般跟别人一样的操作,直接双击 XX.exe,提示缺少什么dll,就去Qt的安装目录下的bin文件夹里去找。我找的目录是D:\Qt\Qt5.2.0\5.2.0\msvc2010\bin
2. This application failed to start because it could not find or load the Qt platform plugin "windows"
复制所需的dll后,提示了这个错误。这个错误的解决方案是:
1.可能缺少复制 libEGL.dll
2.需要把D:\Qt\Qt5.2.0\5.2.0\msvc2010\plugins\platforms\qwindows.dll,带红色的复制到你的exe执行文件目录。就是platforms文件夹,里面一个qwindows.dll
3.复制你exe需要的qt插件
首先要在程序中的 main函数中加上 QApplication::addLibraryPath("./plugins");我写的Qt程序只用到了image插件,需要把 D:\Qt\Qt5.2.0\5.2.0\msvc2010\plugins\imageformats,带红色的文件夹包括imageformats里的大部分dll复制到exe执行文件目录就OK了,如果用到数据库插件等,也要复制。
4.使用Process Explorer 查看exe使用的dll
发布我的程序TextureUnpacker时,Process Explorer帮助非常大,我们用Qt Creator 运行我们将要发布的程序时,就可以用 Process Explorer 查看exe使用的dll了,除了C:windows\system32的中的像下图红框中的就要关注了,程序运行失败很可能就是少了对应的dll文件。5.最后是我用qt 5.2写的一个简单程序所需要的dll列表:
相关文章推荐
- Qt5 中发布程序遇到could not find or load the Qt platform plugin "windows"
- Qt5 中发布程序遇到could not find or load the Qt platform plugin "windows"
- Qt5 中发布程序遇到could not find or load the Qt platform plugin "windows"
- Qt程序部署时遇到的坑:could not find or load the Qt platform plugin "windows"
- Qt5程序错误:could not find or load the Qt platform plugin "windows"
- "it could not find or load the Qt platform plugin "windows""解决方法
- 有关This application failed to start because it could not find or load the Qt platform plugin "windows
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- 问题解决:it could not find or load the Qt platform plugin "windows"
- 解决QT5.5.1 could not find or load the Qt platform plugin "windows"
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- This application failed start because it could not find or load the Qt platform plugin "windows in"
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- it could not find or load the Qt platform plugin "windows"
- 1.定义初始化为false的bool类型、2.qtrelease版本发布时,提示:could not find or load the Qt platform plugin "window"
- Qt程序运行提示“it could not find or load the QT platform plugin “windows””
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- Qt release之后运行显示it could not find or load the Qt platform plugin "windows".解决方法
- 问题解决:it could not find or load the Qt platform plugin "windows"