Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED]Failed to load platform plugin "windows"
QtWS25 Last Chance

[SOLVED]Failed to load platform plugin "windows"

Scheduled Pinned Locked Moved Installation and Deployment
47 Posts 17 Posters 178.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HarrySatt
    wrote on last edited by
    #1

    I am working on Qt5.0.0rc2 and build for VS2010 64bit. I installed the VS AddIn for the RC2. Compiling was successful with minor problems as ending 5s in the names of the libs preconfigured with the VSAddIn. Thats all Ok for me. I started a debug session and got the error message stated above.
    Failed to load platform plugin "windows". Available platforms are:
    none. No platforms were listed. I think there is one more abstraction layer introduced in Qt4.8 and mandatory for Qt5.0 but I do not find a way or hint how to build this plugins.
    some ideas?
    Thanx, Harald.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      The platform abstraction has been completely reworked. The required plugins should have been built automatically, and they can be found in <code>qtbase/plugins/platforms</code>.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        HarrySatt
        wrote on last edited by
        #3

        Thanks Lukas. After a little debugging I found that one enviroment variable was not set correctly. The name of this is "QT_QPA_PLATFORM_PLUGIN_PATH". After creating this varible in the enviroment and setting it to the path you explained above the program started normally. Thanx fine. That was fast. I can close the post.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          John Peterson
          wrote on last edited by
          #4

          This message is returned from a program that was built without

          // This file is autogenerated by qmake. It imports static plugin classes for
          // static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
          #include <QtPlugin>
          Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)

          Please link to the documentation for this.

          Problem

          Some or all tests are built without this from

          qmake

          Workaround

          SOURCES += plugin_import.cpp
          LIBS += Qt5PlatformSupportd.lib windowsd.lib rpcrt4.lib

          1 Reply Last reply
          0
          • H Offline
            H Offline
            HarrySatt
            wrote on last edited by
            #5

            Hi
            Thanks. I will have a look at it as soon as possible. First I will install the Qt5 release version and the plugin VS release 1.2.0 to see of maybe the environment variable is set with the correct values.
            Regards, Harald

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on last edited by
              #6

              Be aware that you will neither have to specify QT_QPA_PLATFORM_PLUGIN_PATH nor import the platform plugin (if you do not build statically) as long as you deploy it correctly to a folder named platforms relative to your application.

              1 Reply Last reply
              0
              • Chris KawaC Online
                Chris KawaC Online
                Chris Kawa
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Btw. Lukas - can you create sticky threads?
                Threads like "can't run from cmd" or "work's fine in creator but not on other machines" about the proper deployment on windows seem to flood this forum lately so maybe it would be beneficial to create a sticky thread with a simple "what you need" for each compiler eg. for MSVC:
                AppDir/App.exe
                AppDir/Qt5Core.dll
                AppDir/Qr5Gui.dll
                ...
                AppDir/platforms/qwindows.dll
                ...
                AppDir/imagefomats/qgif.dll
                ...
                AppDir/sqldrivers/qsqlite.dll
                ...

                • install MSVC runtime package

                What do you think?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  MuldeR
                  wrote on last edited by
                  #8

                  [quote author="Krzysztof Kawa" date="1357386479"]

                  • install MSVC runtime package[/quote]

                  Just a note about this: With VS2008 (MSVC 9.0) we indeed have to install the MSVC Runtime package, by running the MSVC Redistributable setup program. That's because VS2008 (and VS2005 too) uses WinSxS to manage the CRT DLL's - putting the required CRT DLL's into the same folder as the EXE file does not work. They have to be "registered" with WinSxS. Fortunately with VS2010 and VS2012 Mircrosoft has changed this again, so now the CRT DLL's are just "normal" DLL's you can put into the same folder as the EXE file and that's it :-)

                  And another pitfall: If you use a different compiler for your EXE file than for the Qt DLL's - for example you compile your EXE with MSVC 11.0 but then use the pre-compiled Qt DLL's (with MSVC 10.0) from the official "Qt libraries" package - you will end up with an EXE file that needs the CRT DLL's of MSVC 11.0, but also depends on the Qt DLL's that in turn need the CRT DLL's of MSVC 10.0. In the end you will have to ship both versions of the CRT DLL's for the application to work. This is easy to miss, because on a developer's machine usually all the run-times will be installed globally - because Visual Studio has been installed on the machine...

                  Conclusion: Whenever possible (e.g. license-wise) use the static Qt DLL's with the static MSVC CRT :-)))

                  My OpenSource software at: http://muldersoft.com/

                  Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                  Go visit the coop: http://youtu.be/Jay...

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lgeyer
                    wrote on last edited by
                    #9

                    [quote author="Krzysztof Kawa" date="1357386479"]What do you think?[/quote]

                    Having a deployment guide for Qt 5 is for sure quite a good idea, maybe a "Wiki article":http://qt-project.org/wiki/ or a "FAQ entry":http://qt-project.org/faq - which can be linked in a sticky thread or at least as reference one can point to.

                    The thing is - one who will find the Wiki article or the FAQ entry will find one of this existing threads too. One who doesn't usually won't find them either. ;-)

                    Nevertheless definitely a good idea!

                    1 Reply Last reply
                    0
                    • Chris KawaC Online
                      Chris KawaC Online
                      Chris Kawa
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Well there is "this page":http://qt-project.org/doc/qt-4.8/deployment-windows.html obviously but I feel beginners can be a little overwhelmed by the verbosity of the info, since unfortunately most of the time they expect to be told explicitly "copy this form here to there".

                      1 Reply Last reply
                      0
                      • Q Offline
                        Q Offline
                        qthongt
                        wrote on last edited by
                        #11

                        copy the libEGL.dll to there.

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          marco.stanzani
                          wrote on last edited by
                          #12

                          hello all
                          I am using MSVC 2012 and I am migrating from Qt4.8 to Qt.5.1 (or .2 I see it is available now)

                          I want to design a program which works on any PC (either XP, W7 and W8): checking this is cumbersome since my design PC has installe Qt and MSVC redistributable (as part of MSVC2012). In fact the program works perfectly on my PC.

                          I am distributing the program with the InstallShield package which come for free with MSVC2012

                          I understand I need to support the MSVC run time support (done)

                          If I run my application on most of PC I get the infamous error:

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

                          I tried to manually add in the application path of the target pc (not my pc) the directories

                          plugins/platforms/ and put qwindows.dll inside but did not help

                          I am using MSVC project file and InstallShield (as I said). I can see many discussion on this point but I cannot find a conclusive solution for me.

                          What perfectly worked with Qt4 now is not with Qt 5 ...

                          thanks for your help

                          1 Reply Last reply
                          0
                          • N Offline
                            N Offline
                            NetZwerg
                            wrote on last edited by
                            #13

                            We had the same problem try adding more libs:

                            APP-DIR/Qt* // Libs being used
                            APP-DIR/icu* // Internationalization libs
                            APP-DIR/libEGL.dll // This one made our qindows.dll accepted in platforms <====
                            APP-DIR/libGLEv2.dll //..
                            ... any further libs

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              marco.stanzani
                              wrote on last edited by
                              #14

                              I solved adding platforms/qwindows.dll and the libs mentioned above

                              1 Reply Last reply
                              0
                              • K Offline
                                K Offline
                                Komerad
                                wrote on last edited by
                                #15

                                I am having the same problem.

                                First the error showed no available platforms.
                                Adding qwindows.dll to platforms made it show up as "available platforms : windows."

                                But that is still the next step in getting this error.
                                I added libegl.dll.
                                I don't have libGLEv2.dll

                                Thats after installing at the destination.

                                EDIT :
                                At home I have libglev2.dll but no libegl.dll.

                                (installed qt and mingw at both locations and its already different in available dll's.)

                                Even the quick and dirty trick isnt working.
                                So I wrote an app that only works on my computer. Great.

                                mingw.

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  abraker95
                                  wrote on last edited by
                                  #16

                                  I am getting an error exactly as mentioned without any dll files in the error message when executing the release version of the built application, and an error related to QCore.dll as mentioned above when executing the debug version of the built application.

                                  1 Reply Last reply
                                  0
                                  • JKSHJ Offline
                                    JKSHJ Offline
                                    JKSH
                                    Moderators
                                    wrote on last edited by
                                    #17

                                    [quote author="abraker95" date="1402546761"]I am getting an error exactly as mentioned without any dll files in the error message when executing the release version of the built application, and an error related to QCore.dll as mentioned above when executing the debug version of the built application.[/quote]Hi, try http://qt-project.org/wiki/Deploy_an_Application_on_Windows

                                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      abraker95
                                      wrote on last edited by
                                      #18

                                      No luck. I checked to make sure I have the needed file structure, and made sure to include libEGL.dll.

                                      1 Reply Last reply
                                      0
                                      • JKSHJ Offline
                                        JKSHJ Offline
                                        JKSH
                                        Moderators
                                        wrote on last edited by
                                        #19

                                        [quote author="abraker95" date="1402547512"]No luck. I checked to make sure I have the needed file structure, and made sure to include libEGL.dll.[/quote]

                                        Did you include all the DLLs and all the plugin folders?

                                        Does your program run from Qt Creator?

                                        If you answer "yes" to both questions, please post a screenshot of your deployment folder and post the exact error message. To post a screenshot, upload it to an image host (e.g. imgur, flickr) and link to it here.

                                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          abraker95
                                          wrote on last edited by
                                          #20

                                          I copied all the DLL's from the mingw48_32 and msvc2012_opengl folders and all folders within the plugins folder and the application still shows the same error. And no it doesn't work in Qt.

                                          !http://i59.tinypic.com/2wrj42s.jpg(1)!
                                          !http://i59.tinypic.com/30ma2on.jpg(2)!
                                          !http://i61.tinypic.com/2vte6ok.jpg(3)!
                                          !http://i59.tinypic.com/fmmes5.jpg(4)!
                                          !http://i57.tinypic.com/r6wr9i.jpg(Qt)!

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved