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



  • ( qt 5.5.1 static version)
    I create qt app, build project with VS2013, but when I debug it I got error
    This application failed to start because it could not find or load the Qt platform plugin "windows".
    How can I fix the error ?


  • Moderators

    You need to tell qmake in your .pro file to link to the static plugins. See here for instructions.



  • This post is deleted!


  • I don't have .pro file, because I create project in Visual studio. I import plugin in main.cpp .
    But now I have two errors.
    File: C:\ExtLib\Qt\5.5.1\5.5\Src\qtbase\src\corelib\global\qglobal.cpp
    Line: 2966

    ASSERT: "copy" in file C:\ExtLib\Qt\5.5.1\5.5\Src\qtbase\src\corelib\thread\qmutex.cpp, line 525


  • Moderators

    I don't have .pro file

    Ah, then you have to link to the missing plugin .lib manually. I don't think the Qt Add-In automates this in any way. It's in the Project Properties -> Linker -> Input -> Additional dependencies.



  • @AntejaVM Hi.

    I would suggest you to do the following:

    1. Go to your Qt instalation folder (like W:/Qt/5.5/msvc2013).
    2. Go to plugins folder.
    3. Copy platforms directory to the directory with you executable.
      4 (optional). Remove *.pdb and *d.dll files.

    Or just add this folder to your PATH environment variable.


  • Moderators

    @Wilk

    Or just add this folder to your PATH environment variable.

    No! That's a terrible advice. Never pollute PATH with anything Qt related. It's completely unnecessary and you can mess up not only your app but any other that uses Qt.

    Besides, the topic is about static linking, so the point is there are no dlls to copy over. The linking needs to be done at compile time to the static plugin versions.



  • @Chris-Kawa Sorry, my fault, didn't see that it's about static Qt.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.