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.
  • 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
    • H Offline
      H 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
      • A Offline
        A Offline
        abraker95
        wrote on 12 Jun 2014, 19:23 last edited by
        #24

        Then where do I copy libEGL.dll from? Many people claim it to have solved the platform error.

        EDIT: libGLESv2.dll is also located there. The application requests that DLL and it is not located within the msvc2012_opengl's bin folder.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hskoglund
          wrote on 12 Jun 2014, 19:30 last edited by
          #25

          libEGL.dll and libGLESv2.dll are not needed for the msvc2012_opengl compiler.

          If you want, you can read more about this in my "blog post":http://www.tripleboot.org/?p=138 scroll down to "msvc2012_opengl".

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

            Regardless, I still have the same error even after following your blog post (I posted a comment regarding that on your blog some time earlier).

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

              In your blog you write,
              "This deployment is almost the same as the non-OpenGL versions above, but actually easier since there is no libEGL.dll and libGLESv2.dll dependencies."

              Yet I get this when using msvc2012_opengl with no libGLESv2.dll in the directory of the file:
              !http://i62.tinypic.com/10424w0.jpg(compile)!

              1 Reply Last reply
              0
              • A Offline
                A Offline
                abraker95
                wrote on 13 Jun 2014, 00:11 last edited by
                #28

                Update:

                I reinstalled Qt and corrected all the kit's compilers and Qt's. Using Microsoft Visual C++ Compiler 12.0 (x86) and Qt 5.3.0 (msvc2013) I was able to solve the error. However now the program crashes when run. While it runs within Qt, it still shows a crash error in the application output:

                "The instruction at 0x5b175f0d referenced memory at 0x00000000. The memory could not be read.
                Click on OK to terminate the program"

                Edit: Qt shows this:
                "QWindowsWindow::setGeometry: Unable to set geometry 75x23+480+190 on QWidgetWindow/'QPushButtonClassWindow'. Resulting geometry: 124x23+480+190 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 0x0, maximum size: 16777215x16777215).
                Problem creating accessible interface for: QPushButton(0x88fd18)
                Make sure to deploy Qt with accessibility plugins."

                EDIT 2:
                After adding the "Accessible" folder from the plugins directory the program works fine in Qt. It still crashes when not running from Qt, however.

                EDIT 3:
                I rebuilt the debug version of the application and it still shows the platform error. I have no idea why the debug and release versions are showing different results.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  JKSH
                  Moderators
                  wrote on 13 Jun 2014, 01:29 last edited by
                  #29

                  [quote author="abraker95" date="1402618312"]And no it doesn’t work in Qt.[/quote]If it doesn't work in Qt Creator, then it won't work when you try to deploy it. You need to get it to work in Qt Creator first.

                  By the way, "Qt" is the name of the library. "Qt Creator" is the name of the IDE that uses the Qt library.

                  [quote author="abraker95" date="1402618312"]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...[/quote]You must not mix DLLs. Only take from the folder that matches your compiler. DLLs that don't match your compiler will break your program.

                  [quote author="abraker95" date="1402618312"]Yet I get this when using msvc2012_opengl with no libGLESv2.dll in the directory of the file[/quote]I'm guessing this happened because you copied the MinGW DLLs (which DO need libEGL.dll/libGLESv2.dll), and Qt tried to load the non-OpenGL DLLs. Like I said before, don't mix.

                  [quote author="abraker95" date="1402618312"]Qt shows this:
                  “QWindowsWindow::setGeometry: Unable to set geometry 75×23+480+190 on QWidgetWindow/‘QPushButtonClassWindow’. Resulting geometry: 124×23+480+190 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 0×0, maximum size: 16777215×16777215).[/quote]This message is safe and doesn't cause crashes. It appeared because you didn't specify a size for the QPushButton.

                  [quote]Problem creating accessible interface for: QPushButton(0×88fd18)
                  Make sure to deploy Qt with accessibility plugins.”[/quote]This message is safe and doesn't cause crashes. It won't stop your program from running.

                  Anyway, I recommend:

                  Uninstall the versions of Qt that you don't need. Only keep the one that matches your compiler.

                  Remove Qt from your PATH (if you put it there before)

                  Remove MinGW from your PATH (if you put it there before)

                  Delete the build-Hello_World-Desktop-Release folder

                  Start a new project using the Qt Creator wizard: File -> New File or Project... -> Applications -> Qt Widgets Application

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

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    JKSH
                    Moderators
                    wrote on 13 Jun 2014, 01:34 last edited by
                    #30

                    [quote author="abraker95" date="1402618312"]
                    EDIT 2:
                    After adding the "Accessible" folder from the plugins directory the program works fine in Qt. It still crashes when not running from Qt, however.[/quote]That doesn't sound right. If you click the "Run" button, Qt Creator will find the DLLs automatically. You shouldn't need to copy anything.

                    Where did you copy the folder into?

                    After you follow the steps in my previous post, please post a screenshot of Tools -> Options -> Build & Run -> Kits

                    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 13 Jun 2014, 01:40 last edited by
                      #31

                      I copied the folder to where the application is.

                      Here:
                      !http://i59.tinypic.com/xgigj9.jpg(Kit)!

                      1 Reply Last reply
                      0
                      • H Offline
                        H Offline
                        hskoglund
                        wrote on 13 Jun 2014, 03:34 last edited by
                        #32

                        Hi, I see on your computer, MinGW and Visual Studio are both installed, this will invariably lead to problems. I think, if you want to have 2 different compilers, you need to have 2 different computers.

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          JKSH
                          Moderators
                          wrote on 13 Jun 2014, 04:11 last edited by
                          #33

                          @abraker95: I'm surprised that you don't have anything auto-detected. How did you install Qt? What packages did you download?

                          [quote author="hskoglund" date="1402630458"]Hi, I see on your computer, MinGW and Visual Studio are both installed, this will invariably lead to problems. I think, if you want to have 2 different compilers, you need to have 2 different computers. [/quote]That in itself isn't an issue. I have Qt for both MinGW and MSVC 2013 on my computer; they can coexist just fine.

                          However, abraker95 has done manual configuration for his kits, so they might not have been set up correctly. That why I recommended removing Qt and MinGW from the PATH, and uninstalling unneeded copies.

                          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 13 Jun 2014, 17:32 last edited by
                            #34

                            I finally got both the debug and release versions of the applications working from Qt and from the folders when the appropriate DLL's are copied. However, as you have said, Qt doesn't want to auto-detect anything.

                            These are the environment variables I found relating to Qt in the projects tab on the left:
                            PATH: C:\Qt\5.3\msvc2013\bin
                            QTDIR: C:\Qt\5.3\msvc2013

                            I found no environment variables relating to MingW (I do have it installed, though). More confusing, why doesn't the application run from Qt when clearly the path to the Qt version is set without the copied DLL's?

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              abraker95
                              wrote on 14 Jun 2014, 18:35 last edited by
                              #35

                              I finally solved that problem too!
                              Thank this thread: "Fix":http://qt-project.org/forums/viewthread/29372

                              So to get the application to be run from Qt without copying DLL's over, you will have to add an environment variable to the project's settings. Note that I'm using msvc2013 in this example, so replace that with what you are using. Here are the baby steps on doing this:

                              1. Head over to the projects tab on the left
                              2. On the top you will see the kit(s) you are using to build the project with. Click on run (which is right next to "build"). This will bring you to a similar, yet a little different page.
                              3. Scroll down until you see Run Environment
                              4. Click on details on the right to expand the section
                              5. Click on the add button on right
                              6. Type or Copy/Paste QT_QPA_PLATFORM_PLUGIN_PATH as the variable name on the lest column.
                              7. In the right column, type in the directory in which you platform is in. In my case, it is "C:\Qt\5.3\msvc2013\plugins\platforms".
                              8. Run the project

                              Edit: For step 7, "$(QTDIR)\plugins\platforms" should be able to automatically point to the needed directory. Thank this thread: "link":http://qt-project.org/forums/viewthread/26001

                              If you are getting any errors relating to DLL's or something like so:
                              "The instruction at 0×5b175f0d referenced memory at 0×00000000. The memory could not be read.
                              Click on OK to terminate the program"
                              Then you probably don't have an environment variable pointing to the bin directory of the compiler you are using.

                              I wish the process would have been simpler. hskoglund, perhaps you might include this in your blog as well?

                              1 Reply Last reply
                              0
                              • H Offline
                                H Offline
                                hskoglund
                                wrote on 14 Jun 2014, 22:33 last edited by
                                #36

                                Hi, it's in "my blog":http://www.tripleboot.org/?p=536 (scroll down to bonus contents) but I had a spelling error: -QT_QPA_PLUGIN_PATH- fixed now.

                                Good it worked for you, but using QT_ QPA_PLATFORM_PLUGIN_PATH I think has 2 disadvantages:

                                1. If your app depends on other plugins/subdirectories, for example imageformats or sqldrivers, then this environment variable has no effect
                                2. if you deploy your app to another computer then you must remember to set the environment variable on that computer as well.
                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  abraker95
                                  wrote on 14 Jun 2014, 22:35 last edited by
                                  #37

                                  I wonder why the IDE doesn't set the platform directory by default.

                                  1 Reply Last reply
                                  0
                                  • H Offline
                                    H Offline
                                    hskoglund
                                    wrote on 14 Jun 2014, 22:52 last edited by
                                    #38

                                    It does when you install Qt, the installer writes the plugin path into Qt5Core.dll and qmake.exe.

                                    1 Reply Last reply
                                    0
                                    • F Offline
                                      F Offline
                                      frankiefrank
                                      wrote on 20 Jul 2014, 11:19 last edited by
                                      #39

                                      hskoglund - that last comment really helped me out! I was changing Qt versions, copied my DLLs (including Qt5Cored.dll) to the deployment target location. After a while I needed to reinstall the Qt version and I didn't have a clue why it wouldn't work - until I read your comment about the installer's change.

                                      "Roads? Where we're going, we don't need roads."

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        silviutp
                                        wrote on 17 Sept 2014, 09:02 last edited by
                                        #40

                                        I have also had headakes with my app which worked in Qt Creator and on my computer but not on other computer.
                                        The problem was that I was not using the correct qwindows.dll. I used the version from P:\Qt\Qt5.1.1-mingw\Tools\QtCreator\bin\plugins\platforms.
                                        The correct version is in P:\Qt\Qt5.1.1-mingw\5.1.1\mingw48_32\plugins\platforms
                                        As hskoglund said, you should'n probably use dlls from qtcreator folder.

                                        1 Reply Last reply
                                        0
                                        • SavedS Offline
                                          SavedS Offline
                                          Saved
                                          wrote on 21 Apr 2015, 14:10 last edited by
                                          #41

                                          Hello,

                                          I have a similar problem. I've read some stuff, but nothing works for me.

                                          I've deploy my application with windeployqt (Readed here and here). On my PC the solution works fine. Another PC has following error message:

                                          This application failed to start because it could not find or load the Qt platform plugin "windows".
                                          
                                          Reinstalling the application may fix this problem.
                                          

                                          Following steps I've tried:

                                          1. Created with platforms sub-folder. The error message was extended in this case to:

                                            This application failed to start because it could not find or load the Qt platform plugin "windows".
                                            
                                            Available platform plugins are: minimal, offscreen, windows, windows.,
                                            
                                            Reinstalling the application may fix this problem.
                                            
                                          2. Used dependency walker for checking the dlls.

                                            IESHIMS.DLL		-> also missing on my PC
                                            SHLWAPI.DLL
                                            IEFRAME.DLL		-> this one is the deley-load depenceny (see error message below)
                                            
                                            Warning: At least one delay-load dependency module was not found.
                                            Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
                                            

                                            Copying the ieframe.dll from C:\Windows\System32 to release folder will also not fix it.

                                          3. Checked this. No success.

                                          4. Trying to add to main.cpp

                                            QCoreApplication::addLibraryPath("./");
                                            QCoreApplication::addLibraryPath("./platforms");
                                            

                                            No success.

                                          5. Also checked this thread.

                                          6. Also tried to add libEGL.dll to the package. No success.

                                          I developing on Windows XP with Qt 5.4 and MinGW 4.91 32 bit compiler. Some test PC's are Windows 7.

                                          Has anyone hints for me? The message "no windows plugin. Available plugins windows, windows" is also strange.

                                          J 1 Reply Last reply 21 Apr 2015, 14:16
                                          0

                                          • Login

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