Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Could not load Qt platform plugin "windows"
Forum Update on Monday, May 27th 2025

[SOLVED] Could not load Qt platform plugin "windows"

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 60.4k 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.
  • Z Offline
    Z Offline
    Zerby
    wrote on 16 Jan 2014, 16:14 last edited by
    #1

    Hello,

    I face a fairly common problem, only that mine seems to be even more deeper than anyone's of yet. I've created an application with Qt5, on my desktop machine. I grapped the .exe and all the .dll's required by DebugView. When I try to run it on my Surface Pro (Windows 8 Pro), I get an error:

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

    Now, I've tried everything I've came across:

    • Added folder called "plarforms" in the directory of the .exe, with dll's:

    qwindows.dll
    qminimal.dll
    qoffscreen.dll

    • Added a folder "plugins" and placed the platforms -folder there

    • Copied the whole plugins folder (although from my Surface's own Qt install, which is Qt5 also though, just
      a version or two newer) to the application folder

    • Copied libEGL.dll to the application folder

    • Created qt.conf with the lines:

    @[Paths]
    Libraries=./plugins@

    Also tried Libraries=./platforms

    NOTHING seems to work. I also now got the same error on another machine, running Window 2008 Server.. I really need a solution for this, can anyone help? :(

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 16 Jan 2014, 16:29 last edited by
      #2

      The stuff you have tried seems to be correct, it should work. Please consult the "deployment guide":http://qt-project.org/doc/qt-5/windows-deployment.html. And try with dependency walker. We'll carry on from there.

      (Z(:^

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zerby
        wrote on 16 Jan 2014, 18:38 last edited by
        #3

        Ah, by DebugView in the OP I actually meant Dependency walker :)

        Thank you very much for that link, of course I had read it before, but now I read it really line by line. I now know the cause of my problem :)

        When I first bundled my app, I grabbed all the Qt and rest of the DLL's Depency Walker showed, from my dev machine. I then tried to run the app on my Surface -> got the error -> Googled around -> copied the qwindows.dll from my Surface's Qt installation! I know took the qwindows.dll from my dev machine, placed in platforms -folder, and vĂ³ila, it runs.

        Now, I do have a question though.. In my dev machine, I have two qwindows.dll's in my C:\Qt\Qt5.1.1 folder:

        C:\Qt\Qt5.1.1\5.1.1\mingw48_32\plugins\platforms\qwindows.dll
        C:\Qt\Qt5.1.1\Tools\QtCreator\bin\plugins\platforms\qwindows.dll

        How do I know which one I should used? I now used the in the mingw48_32 folder, which worked. Should I always take the DLL's Depency Walkers tells me to, from that folder exactly, not from QtCreator folder?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 16 Jan 2014, 19:41 last edited by
          #4

          Never take the one from Qt Creator: it is in no way connected with your code or Qt libraries.

          I'll explain, but it might be a bit long :)
          Qt Creator is designed to be an independent IDE. That means you can run and use it even when you don't have any Qt version or compiler installed on your machine. So, if you need it just for it's Python support, or you are interested in Qt Creator as an IDE for pure C++ projects, you can still use it. Also, if you have several Qt installations working in parallel, it is important that Qt Creator itself is in no way affected by them - that is, it should not link to any external Qt, as it would easily lead to numerous errors.

          So Qt Creator - on all platforms - always bundles a copy of Qt libraries and (through some launch scripts) makes sure it is not influenced by anything thrown into PATH or LD_LIBRARY_PATH. The copies of Qt DLLs you find inside Qt Creator package are not ready to be redistributed, they are there only to make Qt Creator work.

          Phew :) Hope it helps.

          (Z(:^

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            Zerby
            wrote on 16 Jan 2014, 20:11 last edited by
            #5

            Thank you, I think I understand: because Qt Creator is created using Qt library, ofcourse the dll's inside it's folders are for itself! Right?

            And yes, I do primarily use Qt Creator for all my C++ projects atm, I find it very suitable for all my needs. It's the best I've used so far, although I haven't really used Visual Studio yet... But for now I don't even want to, Qt Creator has everything I need!

            Thank you once again, I'm pretty sure this is solved & I learned much else aswell.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 16 Jan 2014, 20:15 last edited by
              #6

              You're welcome :-) Happy coding!

              (Z(:^

              1 Reply Last reply
              0

              1/6

              16 Jan 2014, 16:14

              • Login

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