无法找到或加载Qt平台插件“ windows”, [英] Could not find or load the Qt platform plugin "windows"
问题描述
首先,为了防止重复的报告,我尝试了给出此处,此处,此处, 此处和此处。
First of all, to prevent duplicate reports I have tried multiple solutions given here, here, here, here and here.
我在Visual Studio 2012中使用Qt 5.5.1,并在Windows 10 x64上开发了我的应用程序(不使用Qt Creator)。应用程序是在发布模式下编译的。
I am using Qt 5.5.1 with Visual Studio 2012 and developed my app on Windows 10 x64 (not using Qt Creator). Application is compiled in release mode.
实际上,我的应用程序在PC上正在运行,没有任何问题,并且是我唯一需要的库目录是:
Actually, my application is working on my PC, without any issues and the only libraries I need in my directory are:
Qt5Core.dll
Qt5Gui.dll
Qt5WinExtras.dll
Qt5Widgets.dll
Qt5Network.dll
msvcp110.dll
msvcr110.dll
现在,当我尝试在Windows 7 x86的全新安装上启动应用程序时,出现以下错误消息:
Now, when I try to launch my application on fresh installation of Windows 7 x86 I am getting the following error message:
此应用程序失败
This application failed to start because it could not find or load the Qt platform plugin "windows".
重新安装该应用程序可能会解决此问题。
Reinstalling the application may fix this problem.
现在我不能摆脱它。根据前面的问题,可能是 qwindows.dll
文件的问题(或更确切地说,应用程序找不到它),首先我进行了一个部署我的发布目录是这样的:
Now I can't get rid of it. According to the previously asked questions it can be a issue with qwindows.dll
file (or more precisely with application couldn't locate it), first of all I made a deploy of my release directory like this:
[..] \msvc2012\bin> windeployqt.exe< PATH>
它已生成启动我的应用程序所需的所有文件,包括 platforms / qwindows.dll
所以我只是将它们全部复制到Windows 7目录中而没有任何作用-仍然会发生错误。
It has generated all files that are needed for my application to launch, including platforms/qwindows.dll
so I have simply copied all of them to Windows 7 directory without any effect - error still occurs.
我还尝试了手动复制 qwindows .dll
来自 msvc2012\plugins\平台
-无效,
I have also tried to manually copy a qwindows.dll
from the msvc2012\plugins\platforms
- no effect,
我所做的最后一步是检查 Dependency Walker 中的应用程序-令人惊讶的是,没有 qwindows.dll
相关依赖项:
Last step I did was a inspection of my application in the Dependency Walker - suprisingly, there is no qwindows.dll
related dependency:
所以我现在没主意了,这里出了什么问题?
So I am out of ideas now, what is the problem here?
推荐答案
这是我在 QOwnNotes (Qt5)下部署的工作Windows: https://github.com/pbek/QOwnNotes/blob/develop/appveyor .yml
This is what I do to deploy QOwnNotes (Qt5) under Windows: https://github.com/pbek/QOwnNotes/blob/develop/appveyor.yml
# AppVeyor build configuration
# http://www.appveyor.com/docs/build-configuration
os: unstable
skip_tags: true
install:
- set QTDIR=C:\Qt\5.5\mingw492_32
- set PATH=%PATH%;%QTDIR%\bin;C:\MinGW\bin
- set RELEASE_PATH=appveyor\release
before_build:
# getting submodules
- git submodule update --init
build_script:
# using a header file without MemoryBarrier, that causes the build to fail
- copy appveyor\qopenglversionfunctions.h %QTDIR%\include\QtGui
# workaround for MinGW bug
- sed -i s/_hypot/hypot/g c:\mingw\include\math.h
- cd src
# we need to modify that to make it running on AppVeyor
- sed -i "s/CONFIG += c++11/QMAKE_CXXFLAGS += -std=gnu++0x/g" QOwnNotes.pro
- "echo #define RELEASE \"AppVeyor\" > release.h"
# setting the build number in the header file
- "echo #define BUILD %APPVEYOR_BUILD_NUMBER% > build_number.h"
- qmake QOwnNotes.pro -r -spec win32-g++
# - qmake QOwnNotes.pro -r -spec win32-g++ "CONFIG+=debug"
- mingw32-make
# creating the release path
- md ..\%RELEASE_PATH%
# copy the binary to our release path
- copy release\QOwnNotes.exe ..\%RELEASE_PATH%
# copy OpenSSL DLLs to the release path
- copy ..\appveyor\OpenSSL\libeay32.dll ..\%RELEASE_PATH%
- copy ..\appveyor\OpenSSL\libssl32.dll ..\%RELEASE_PATH%
- copy ..\appveyor\OpenSSL\ssleay32.dll ..\%RELEASE_PATH%
# copy portable mode launcher to the release path
- copy ..\appveyor\QOwnNotesPortable.bat ..\%RELEASE_PATH%
# copy translation files
- copy languages\*.qm ..\%RELEASE_PATH%
- cd ..\%RELEASE_PATH%
# fetching dependencies of QT app
# http://doc.qt.io/qt-5/windows-deployment.html
- windeployqt --release QOwnNotes.exe
# this dll was missed by windeployqt
- copy ..\libwinpthread-1.dll . /y
# this dll didn't work when released by windeployqt
- copy "..\libstdc++-6.dll" . /y
# for some reason AppVeyor or windeployqt uses a copy of the German
# translation file as English one, which screws up the English user interface
- del "translations\qt_en.qm"
artifacts:
# pushing entire folder as a zip archive
- path: appveyor\release
name: QOwnNotes
deploy:
# Deploy to GitHub Releases
- provider: GitHub
artifact: QOwnNotes
draft: false
prerelease: false
auth_token:
secure: spcyN/Dz3B2GXBPii8IywDLq6vfxC1SrN+xR2wMerFM7g2nTy0Lrh5agQONFoInR
on:
branch: master
notifications:
# Gitter webhook
- provider: Webhook
url: https://webhooks.gitter.im/e/b6ef22402eb4af50f73a
on_build_success: true
on_build_failure: true
on_build_status_changed: false
我希望能有所帮助...
I hope that helps a little...
这篇关于无法找到或加载Qt平台插件“ windows”,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!