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.6k 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 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 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 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 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 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 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 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
                • Chris KawaC Offline
                  Chris KawaC Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on 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
                  0
                  • S Offline
                    S Offline
                    soroush
                    wrote on 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 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 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 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 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
                            • Chris KawaC Chris Kawa

                              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 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