ERROR: This is application failed to start because it could not find or load the Qt platform plugin "windows"

5

I'm having an error while running a program that was created with Qt, it generates the error of the photo! This error is generated when I run the exe, all the dlls indicated in dependency walker are in the exe folder.

Would anyone help me?

Thank you in advance.

    
asked by anonymous 04.03.2015 / 19:05

1 answer

7

From Qt5 you should have the following structure:

+-+ pasta do aplicativo)
  |-- Aplicativo.exe
  |-- Qt5Core.dll
  |-- Qt5Widgets.dll
  |-- outras dlls dos módulos usados
  +-+ platforms
    |-- qwindows.dll

The platforms folder must be at the same level as your .exe, and contain .dll (for Windows, .so in * nix, etc.) for the operating system in question.

In your case just create the "platforms" folder next to the application and put "qwindows.dll" in.


PS: Well observed detail, mentioned by @LuizVieira :

  

I know the question is about Windows. But I think it is worth remembering that in * nix there is no guarantee to work just putting the shared libraries in the same folder as the application. Must define LD_LIBRARY_PATH ( tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html ) or use the QMAKE_LFLAGS_RPATH directive in the .pro ( qt-project.org/doc/qt-4.8/... ).

    
04.03.2015 / 19:25