Qt示例项目不运行

Qt example projects don't run

本文关键字:运行 项目 Qt      更新时间:2023-10-16

我最近下载了QT,并试图熟悉它。但是,我无法运行示例项目!当我尝试运行其中一个示例时,它会退出并显示以下消息:

Starting C:QtExamplesQt-5.4build-gui-Desktop_Qt_5_4_1_MinGW_32bit-Debugrasterwindowdebugrasterwindow.exe...
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: minimal, offscreen.
Reinstalling the application may fix this problem.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
C:QtExamplesQt-5.4build-gui-Desktop_Qt_5_4_1_MinGW_32bit-Debugrasterwindowdebugrasterwindow.exe exited with code 3

我看到了几个关于这个错误的问题,但所有问题都是使用Visual Studio的。我只是使用默认的QT编辑器,并没有对示例项目进行任何更改。此外,当我尝试编写一个简单地创建窗口的基本应用程序时,它运行时没有错误消息,但没有创建窗口。我仍然可以编写一个使用cout的"helloworld"程序,但QT不会创建小部件窗口。

我在Windows7 32位,使用默认的Qt编辑器。安装过程中是否跳过了一些重要步骤?我刚刚运行了安装程序的可执行文件。

错误是由于程序找不到qwindows.dll。

您应该在platforms目录中选中qwindows.dll

.../platforms/qwindows.dll