C++ 无法找到或加载Qt平台插件";“窗口”;

C++ 无法找到或加载Qt平台插件";“窗口”;,c++,windows,visual-studio,qt,dll,C++,Windows,Visual Studio,Qt,Dll,首先,为了防止重复报告,我尝试了提供、和的多种解决方案。 我在Visual Studio 2012中使用Qt 5.5.1,并在Windows 10 x64上开发了我的应用程序(不使用Qt Creator)。应用程序是在发布模式下编译的 实际上,我的应用程序在我的电脑上运行,没有任何问题,我的目录中唯一需要的库是: Qt5Core.dll Qt5Gui.dll Qt5WinExtras.dll Qt5Widgets.dll Qt5Network.dll msvcp110.dll msvcr110.

首先,为了防止重复报告,我尝试了提供、和的多种解决方案。

我在Visual Studio 2012中使用Qt 5.5.1,并在Windows 10 x64上开发了我的应用程序(不使用Qt Creator)。应用程序是在发布模式下编译的

实际上,我的应用程序在我的电脑上运行,没有任何问题,我的目录中唯一需要的库是:

Qt5Core.dll
Qt5Gui.dll
Qt5WinExtras.dll
Qt5Widgets.dll
Qt5Network.dll
msvcp110.dll
msvcr110.dll
现在,当我尝试在新安装的Windows 7 x86上启动应用程序时,收到以下错误消息:

此应用程序无法启动,因为它无法找到或加载Qt平台插件“windows”

重新安装应用程序可能会解决此问题

现在我无法摆脱它。根据前面提出的问题,这可能是由于
qwindows.dll
文件的问题(或者更准确地说是由于应用程序找不到它),首先我对我的发布目录进行了如下部署:

[…]\msvc2012\bin>windeployqt.exe


它生成了我的应用程序启动所需的所有文件,包括
platforms/qwindows.dll
,因此我只是简单地将所有文件复制到Windows 7目录中,没有任何影响-错误仍然发生

我还尝试从
msvc2012\plugins\platforms
手动复制
qwindows.dll
-无效

我做的最后一步是在中检查我的应用程序-令人惊讶的是,没有
qwindows.dll
相关依赖项:


所以我现在没有主意了,这里的问题是什么?

这是我在Windows下部署(Qt5)的方法:


我希望这有点帮助……

它不会显示为依赖关系,但它仍然是。您是否将其放在与可执行文件相关的
platforms
文件夹中?@ddriver是的,已经尝试了多种方法,包括在
qt.conf
中定义路径“我只是将所有文件复制到了Windows 7”:您在Windows 7中到底复制了哪些文件?@这很有帮助,这并不重要,因为我的应用程序
.exe
就在那里,所以它可能在桌面文件夹或文档中。重要的是结构是一样的<代码>http://i.imgur.com/k91bYHg.png。。。请编辑您的问题并添加已部署的所有文件,好吗?(我指的是确切的目录结构)您能告诉我如何在windows中执行上面的yml吗?我无法让QOwnNotes最新的win发行版在win 10上运行。
appveyor.yml
不是要在Windows上“运行”的。AppVeyor将其解释为构建QOwnNotes,但您可以看到我所做的。>我无法让QOwnNotes最新win发行版在win 10上运行您想实现什么,@NikhilVJ?可能会在上发布问题。对不起,我已经发布了问题。让它与以前的版本一起工作。
# 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