我一直在谷歌搜索这个问题的解决方案,虽然我发现很多人分享我的问题,他们的解决方案都没有为我工作.
我使用Visual Studio 2010使用Qt框架编写了一个C应用程序.我在Visual Studio中以“发布”模式构建并运行应用程序而没有问题,但是当我将该文件夹从Release文件夹复制到新目的地时(假装它是一台新PC) )它无法运行提供此错误:
---------------------------
TestApplication
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: windows.
Reinstalling the application may fix this problem.
在可执行文件目录中,我有以下文件结构:
./TestApplication.exe
./libGLESv2.dll
./Qt5Core.dll
./Qt5Gui.dll
./QtWidgets.dll
./platforms/qwindows.dll
./qt.conf
所有dll文件都取自Qt的5.0.0版本,该文件夹位于库所在的Qtbase文件夹中.
qt.conf文件是:
[Paths]
Plugins=.
没有它,启动错误是相同的,除了它说“minimal”和“offscreen”也是可用的平台.
对于遇到此错误的所有其他人,似乎可以通过创建平台文件夹并放入qwindows.dll来解决.但自己这样做并不会改变任何行为.
有什么我做错了吗?也许我首先生成.exe的方法是错误的?