Qwindows.dll从未找到 [英] Qwindows.dll Never Found In

查看:151
本文介绍了Qwindows.dll从未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在其他机器上运行我的应用程序,如果我重命名Qt目录,我得到这个应用程序启动失败,因为它找不到或加载Qt平台插件Windows重新安装应用程序可能会修复这个问题。
这是保存应用程序的文件夹的布局:

  app.exe 
icudt53.dll
icuin53.dll
icuuc53.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
msvcp110.dll
platforms / qwindows.dll

有没有可能强制寻求qwindows.dll的应用程序的目录,而不是QT目录?

解决方案

Qt安装目录不应在您的PATH环境中。然后重命名Qt目录是不必要的(与OSX相反)。在开发过程中,您可以从Qt Creator内部运行应用程序。



如果您在Qt Creator之外运行应用程序,例如通过在浏览器中双击它,Windows也会自动在其搜索路径中包含应用程序目录事实上,这是它将要看的第一个位置。如果它找不到dll,或者是错误的版本(如32 / 64bit),它会尝试在其他地方找到它。不需要设置或加载库路径。使用依赖性步行者来查找你需要的dll。从Qt安装目录中复制它们,或者从Microsoft vc-repistributable exe中提取它们,以防需要msvc dll(我想你错过了msvcr dll)。所有这些dll复制最好用qmake脚本完成。您的应用程序需要哪个插件Qt dll是一个试验和错误的问题。对于一些缺少的插件dll,操作系统将在运行应用程序时发出警告。



您可以使用 windeployqt 。我们喜欢控制自己将要部署的数据。



您的插件平台的位置 qwindows.dll 是正确的。该应用程序不加载插件dll,但Qt dll加载插件dll和这些Qt dll的确切知道在哪里可以找到它们。我可以想象你有问题的唯一原因是你的应用程序加载了错误的Qt dll,并且dll找不到平台dll。不要忘记许多其他多平台应用程序也使用Qt。他们可能已经将qt dll转储到system32目录中,或者通过将其应用程序目录添加到PATH环境中来暴露它们。欢迎来到dll地狱。



有一个简单的方法来打击dll地狱:从你的应用程序中删除(和恢复)dll的一个一个,每次双点击你的应用程序如果Windows没有抱怨完全没有丢失那个dll,那么dll不是正确的版本。如果这还没有帮助,你可能会错过您应用程序正在使用的另一个Qt dll。


When I run my application in other machine and if i rename the Qt directory i'm getting the "This application failed to start because it could not find or load the Qt platform plugin "windows". Reinstalling the application may fix this problem." Here's the layout of the folder holding the application:

app.exe
icudt53.dll
icuin53.dll
icuuc53.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
msvcp110.dll
platforms/qwindows.dll

Is there any possibility to force the seek qwindows.dll for directory of my application instead of the QT directory?

解决方案

Qt install directory should not be in your PATH environment. Then renaming the Qt dir is not necessary (in contrast to OSX). During development you can run your application from inside Qt Creator.

If you run your application outside Qt Creator, for instance by double clicking on it in explorer, Windows will also automatically include in its search path the application dir and as a matter of fact it is the first location it will look. If it cannot find the dll there, or if it is the wrong version (like 32/64bit) it will try to find it somewhere else. There is no need to set or load library paths. Use dependency walker to find out what dll's you need. Copy them from the Qt Install dir or extract them from the Microsoft vc-redistributable exe in case a msvc dll is needed (I think you are missing the msvcr dll). All this dll copying should be preferably done with a qmake script. Which plugin Qt dll your application need is a matter of trial and error. For some missing plugin dll's the OS will issue a warning when running the appplication.

You could follow Pim's advice by using windeployqt. We prefer to control ourselves what dll's are going to be deployed.

Your location of the plugin platforms qwindows.dll is exactly correct. The application does not load the plugin dll's but the Qt dll's load the plugin dll's and these Qt dll's know exactly where to expect and find them. The only reason I can imagine that you have problems is that your app loads the wrong Qt dll and that dll cannot find the platforms dll. Do not forget that many other multi-platform applications use Qt as well. They might have dumped Qt dll's in the system32 directory or they might expose them by adding their application dir to the PATH environment. Welcome to the dll hell.

There is a simple approach to fight the dll hell: remove (and restore) from your app dir the dll's one by one and each time double click your app. If Windows does not complain about missing exactly that dll you just removed that dll was not the correct version. If this still does not help you are probably missing out another Qt dll your application is using.

这篇关于Qwindows.dll从未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆