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"

[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.
  • J Offline
    J Offline
    John Peterson
    wrote on 4 Jan 2013, 21:14 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 5 Jan 2013, 00:01 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 5 Jan 2013, 09:12 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
        • C Online
          C Online
          Chris Kawa
          Lifetime Qt Champion
          wrote on 5 Jan 2013, 11:47 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 5 Jan 2013, 16:33 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 5 Jan 2013, 17:43 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
              • C Online
                C Online
                Chris Kawa
                Lifetime Qt Champion
                wrote on 5 Jan 2013, 18:01 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 2 Oct 2013, 12:55 last edited by
                  #11

                  copy the libEGL.dll to there.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    marco.stanzani
                    wrote on 8 Jan 2014, 09:54 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 21 Jan 2014, 08:42 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 21 Jan 2014, 10:45 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 3 Mar 2014, 12:32 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 12 Jun 2014, 04:19 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 12 Jun 2014, 04:23 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 12 Jun 2014, 04:31 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 12 Jun 2014, 06:25 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 12 Jun 2014, 17:19 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
                                    • hskoglundH Offline
                                      hskoglundH Offline
                                      hskoglund
                                      wrote on 12 Jun 2014, 18:59 last edited by
                                      #21

                                      Hi your Qt version of mingw48_32 is 5.2.1 and your Qt version of msvc2012_opengl is 5.3.

                                      Copying files from these releases together in one folder is alright, problem arises for the subfolders, in this case the platforms subfolder.

                                      I'm guessing the files in there comes from the 5.2.1 version of Qt, and when qwindows.dll requests a Qt5xxx.dll it will fail because all the Qt5xxx.dlls are from the 5.3 version of Qt. Hence the "plugin" error.

                                      EDIT: what I mean, the main problem is mixup of mingw48_32 and msvc2012 compiler technology, i.e. for a single .exe, it cannot both use .dlls from ming48_32 compiler and msvc2012_compiler.

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        abraker95
                                        wrote on 12 Jun 2014, 19:13 last edited by
                                        #22

                                        The only DLL's I copied from the mingw48_32 folder is the platform since it's the only qWindows.dll I found. The rest of the DLL's come from the msvc2012_opengl folder and the QtCreator's bin folder (such as libEGL.dll).

                                        1 Reply Last reply
                                        0
                                        • hskoglundH Offline
                                          hskoglundH Offline
                                          hskoglund
                                          wrote on 12 Jun 2014, 19:22 last edited by
                                          #23

                                          Hmmm, I also have msvc2012_opengl installed and it has a qwindows.dll for sure.

                                          Also, never copy anything from QtCreator's bin folder, because QtCreator for Qt version 5.3 is built with msvc2010 and Qt version 5.2.1. Best is to think about QtCreator's bin folder as private.

                                          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