2016-10-19 46 views
1

首先,要防止重複報告,我曾嘗試給hereherehereherehere多種解決方案。無法找到或加載了Qt平臺插件「窗口」

我在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平臺插件「窗口」。

重新安裝應用程序可能會解決此問題。

現在我無法擺脫它。按照以前提出的問題它可以與qwindows.dll文件中的問題(或者更精確地使用應用程序無法找到它),首先我做了我發佈目錄的部署是這樣的:

[..]\msvc2012\bin>windeployqt.exe <PATH>

它已生成我的應用程序啓動所需的所有文件,其中包括platforms/qwindows.dll,因此我已將它們全部複製到Windows 7目錄中,但沒有任何影響 - 仍會出現錯誤。

我也曾嘗試手動將qwindows.dllmsvc2012\plugins\platforms複製 - 沒有效果,

最後一步我所做的是我的應用程序的檢查Dependency Walker - 令人驚訝,沒有qwindows.dll相關的依賴性:

image

所以我現在沒有想法了,這裏有什麼問題?

+0

它不會顯示爲一個依賴,但它仍不失爲。你把它放在相對於可執行文件的「平臺」文件夾中嗎? – dtech

+0

@ddriver是的,一直在嘗試多種方式,包括在'qt.conf'中定義路徑。 –

+0

「我只是簡單地將所有這些文件複製到Windows 7」:您在Windows 7中確實複製了哪些文件? – wasthishelpful

回答

0

這是我做的部署QOwnNotes(QT5)在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 

我希望幫助一點點......

相關問題