应用程序无法启动,因为它无法找到或加载 QT 平

时间:2023-01-23
本文介绍了应用程序无法启动,因为它无法找到或加载 QT 平台插件“windows"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经查看了似乎与堆栈溢出相关的所有问题,但似乎没有任何解决方案对我有帮助.

I have looked through all of the questions that appear to be related on stack overflow, and none of the solutions seem to help me.

我正在使用此设置构建 Qt 应用程序:

I am building a Qt application with this setup:

  • Windows 7 专业版 x64
  • Visual Studio 2012
  • 使用 configure -developer-build -debug-and-release -opensource -nomake examples -nomake tests -platform win32-msvc2012 -no-opengl
  • 构建的 Qt 5.2.0
  • 项目使用 QtSingleApplication (qt-solutions)
  • 应用程序是一个 32 位应用程序
  • qmake 使用以下命令运行:-makefile -spec win32-msvc2012
  • .pri 使用 QMAKE_CXX +=/D_US​​ING_V110_SDK71_

我可以在我的开发机器上很好地构建和运行我的程序(如上所述);我也可以从开发机器上的 Program Files 目录安装和运行包.

I can build and run my program fine on my development machine (noted above); I can also install and run the package from Program Files directory on dev machine.

当我在一台 Windows Vista 机器(多台机器)上安装并运行时

When I install and run on a Windows Vista machine (multiple machines)

  • VC++ redist 2012 11.0.61030.0 已安装
  • VC++ redist 2010 10.0.40219 已安装
  • 加上 2005、2008 版本的 redist

(在全新安装 Windows 7 时也会失败)

(also fails on a clean install of Windows 7)

我明白了:

应用程序无法启动,因为它无法找到或加载 QT 平台插件windows"

所以我按照说明添加了一个.platforms/目录,并添加了qwindows.dll(也添加了qminimal.dll和qoffscreen.dll);我还添加了 libEGL.dll、libGLESv2.dll(尽管我认为不需要它们)

So I followed the instructions and added a .platforms/ directory, and added qwindows.dll (also added qminimal.dll and qoffscreen.dll); I also added libEGL.dll, libGLESv2.dll (even though I shouldn't need them I don't think)

添加 qoffscreen.dll 后,我现在收到附加消息:可用的平台插件是:offscreen

Once I added qoffscreen.dll I now get the additional message: Available platform plugins are: offscreen

如果我运行 Dependency Walker,则会列出此错误:

If I run through Dependency Walker I get this error listed:

GetProcAddress(0x76CA0000 [KERNEL32.DLL], "GetCurrentPackageId") called from "MSVCR110.DLL" at address 0x6AC6FDFA and returned NULL. Error: The specified procedure could not be found (127).

然后进一步向下得到:

GetProcAddress(0x745A0000 [UXTHEME.DLL], "BufferedPaintUnInit") called from "COMCTL32.DLL" at address 0x745FFBF8 and returned 0x745AE18C.
This application failed to start because it could not find or load the Qt platform plugin "windows".

Available platform plugins are: offscreen.

Reinstalling the application may fix this problem.

任何想法如何解决这个 dll 问题?

Any ideas how to fix this dll issue?

推荐答案

好吧,我解决了我的问题,虽然我不确定有什么区别:

Well I solved my issue, although I'm not sure what the difference is:

我将 qt 目录中的每个 dll 都复制到了应用程序目录的 ./和 ./platforms 中.

I copied every dll from my qt directory into both ./ and ./platforms of my application directory.

应用程序克服了错误,但随后崩溃了.

The application got past the error, but then crashed.

VERSION.dll 导致崩溃(在依赖项walker 中注明),所以我从两个地方都删除了它.

VERSION.dll was causing the crash (noted in dependency walker), so I removed it from both places.

应用程序启动了,所以我系统地删除了所有不需要的 dll.

The Application started up, so I systematically removed all unneeded dll's.

这让我回到了最初的状态.

This got me back to the same state I had originally.

然后我卸载了我的应用程序并重新安装(只剩下 ./platforms/qwindows.dll 文件),应用程序正常工作.

I then uninstalled my application and re-installed (with only the ./platforms/qwindows.dll file remaining), application works correctly.

所以我只能假设我在平台目录中的 qwindows.dll 版本不正确.

So all I can assume is that I had an incorrect version of qwindows.dll in the platforms directory.

这篇关于应用程序无法启动,因为它无法找到或加载 QT 平台插件“windows"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

上一篇:无法找到过程入口点 __gxx_personality_v0 下一篇:如何将 OpenCV cv::Mat 转换为 QImage

相关文章

最新文章