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] Failed to load platform plugin.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Failed to load platform plugin.

Scheduled Pinned Locked Moved General and Desktop
16 Posts 8 Posters 27.5k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    soroush
    wrote on 4 Jan 2013, 09:42 last edited by
    #1

    I have compiled Qt5 libraries for Windows using MinGW. Programs compiled with that version doesn't run on 64 bit Windows. AFAIK it should be possible to run a 32bit application on 64bit machine. The error seems something related to msvcrt.dll :

    !http://s1.picofile.com/file/7607928167/x86_qt5_error.png(test)!

    For 64-bit versions, there is no problem. This is the simple "test GUI test":http://s3.picofile.com/file/7607874836/Q.7z.html program containing all DLLs needed to run (including msvcrt.dll)

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 4 Jan 2013, 09:58 last edited by
      #2

      You can run 32 bit applications on 64 bit windows. I am running minGW compiled 32 bit applications on Windows 7 64 bit.

      Did you check the required dlls with the dependency walker already?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        soroush
        wrote on 4 Jan 2013, 11:11 last edited by
        #3

        [quote author="koahnig" date="1357293503"]
        Did you check the required dlls with the dependency walker already? [/quote]

        Yes. Everything looks sane to me. I double-echecked PATH, architectures of binaries, and everything else. Can't find the problem...

        Program exits with following error message:
        @
        Failed to load platform plugin "windows". Available platforms are:

        Invalid parameter passed to C runtime function.
        Invalid parameter passed to C runtime function.
        @

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on 4 Jan 2013, 11:26 last edited by
          #4

          Did you deploy platform/qwindows.dll as well? (It will not show up in Dependency Walker).

          1 Reply Last reply
          0
          • S Offline
            S Offline
            soroush
            wrote on 4 Jan 2013, 11:54 last edited by
            #5

            [quote author="Lukas Geyer" date="1357298812"]Did you deploy platform/qwindows.dll as well? (It will not show up in Dependency Walker).[/quote]

            No I didn't know about that. It's not present in installation directory. It's in qtbase/plugin/platform. Though adding that file, program does not run yet.

            I made a 7z archive of all DLL s that Dependency Walker can see + msvcrt . It just don't run on any 64bit windows machine. I had no chance to test with 32 yet

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on 4 Jan 2013, 12:07 last edited by
              #6

              It is actually platform s /qwindows.dll, not platform/qwindows.dll. Be aware that you will have to deploy platforms/qwindows d .dll if you are deploying a debug build.

              With these changes, do you still get <code>Failed to load platform plugin "windows". Available platforms are:</code>?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                soroush
                wrote on 4 Jan 2013, 12:38 last edited by
                #7

                [quote author="Lukas Geyer" date="1357301238"]It is actually platform s /qwindows.dll, not platform/qwindows.dll.[/quote]

                Yea, my typo

                [quote author="Lukas Geyer" date="1357301238"]Be aware that you will have to deploy platforms/qwindows d .dll if you are deploying a debug build.

                With these changes, do you still get <code>Failed to load platform plugin "windows". Available platforms are:</code>?[/quote]

                I tried both debug and release builds with libraries with/without debugging symbols. It's still same.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lgeyer
                  wrote on 4 Jan 2013, 13:15 last edited by
                  #8

                  Using the <code>-platformpluginpath</code> command line option or the <code>QT_QPA_PLATFORM_PLUGIN_PATH</code> environment variable might be another option, but Qt should pickup the plugin automatically when placed in the correct location.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    soroush
                    wrote on 4 Jan 2013, 14:24 last edited by
                    #9

                    [quote author="Lukas Geyer" date="1357305345"]Using the <code>-platformpluginpath</code> command line option or the <code>QT_QPA_PLATFORM_PLUGIN_PATH</code> environment variable might be another option, but Qt should pickup the plugin automatically when placed in the correct location.[/quote]

                    It is there, I copied everything beside the program executable. I believe it's in visible scope for linkage. The problem might be related to msvcrt .

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      Chris Kawa
                      Lifetime Qt Champion
                      wrote on 4 Jan 2013, 14:40 last edited by
                      #10

                      qwindows.dll shouldn't be in the same dir as the executable. Put it in the platforms subdirectory.

                      W 1 Reply Last reply 6 Sept 2015, 17:21
                      0
                      • S Offline
                        S Offline
                        soroush
                        wrote on 4 Jan 2013, 14:54 last edited by
                        #11

                        [quote author="Krzysztof Kawa" date="1357310438"]qwindows.dll shouldn't be in the same dir as the executable. Put it in the platforms subdirectory.[/quote]
                        Ah my bad memory :P In fact I have had same problem with paths for mysql driver on windows... Now works fine.

                        Thank you

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          MuldeR
                          wrote on 4 Jan 2013, 20:36 last edited by
                          #12

                          [quote author="Lukas Geyer" date="1357298812"]Did you deploy platform/qwindows.dll as well? (It will not show up in Dependency Walker).[/quote]

                          FWIW: DLL's that are loaded at runtime, like Plug-in DLL's, do show up in Dependency Walker, but only when you use the "profiling" feature. They of course cannot be found by only analyzing the static import tables...

                          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 6 Jan 2013, 12:14 last edited by
                            #13

                            Profiling never worked quite well for me (STATUS_STACK_BUFFER_OVERRUN and alike), but good to know. Thanks for sharing.

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              ThomasAn
                              wrote on 6 Feb 2013, 22:00 last edited by
                              #14

                              Can you elaborate how this issue was fixed ?
                              You created a "platforms" directory inside your project folder and put the qwindows.dll in there ?

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                Shuhard
                                wrote on 5 Mar 2013, 16:11 last edited by
                                #15

                                Looks like you have to create "platforms" directory in folder, were your program runs. For example, I have "debug" folder in my project, and I copied "platforms" directory there from "c:\Qt\Qt5.0.1\5.0.1\mingw47_32\plugins". This solved my problem.

                                Also you can copy other plugins if needed.

                                1 Reply Last reply
                                0
                                • C Chris Kawa
                                  4 Jan 2013, 14:40

                                  qwindows.dll shouldn't be in the same dir as the executable. Put it in the platforms subdirectory.

                                  W Offline
                                  W Offline
                                  welmore
                                  wrote on 6 Sept 2015, 17:21 last edited by
                                  #16

                                  @Chris-Kawa

                                  Hi. I did as you said and it worked! thanks!
                                  welmore

                                  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