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. Deploying qt5.2.0: won't find windows platform plugin
QtWS25 Last Chance

Deploying qt5.2.0: won't find windows platform plugin

Scheduled Pinned Locked Moved Installation and Deployment
37 Posts 9 Posters 29.8k 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
    Angivare
    wrote on last edited by
    #1

    Hello, I am trying to deploy an application I wrote with QtCreator 5.2.0, using the MinGW 4.8 compilator.
    I compiled it in release mode, but I can't seem to make it work on a machine without Qt installed: I renamed my Qt dir to Qte so it can't find the dll/plugins in there, and my app's folder is like this:

    app.exe
    other dlls
    libEGL.dll
    libGLESv2.dll
    /platforms/qwindows.dll

    Problem is: my app won't just go and grab that qwindows.dll but still tries to get that plugin from my QTDIR/Qt5.2.0/5.2.0/mingw48_32/plugins/platforms and it's giving me error 'This application failed to start because it could not find or load the Qt platform plugin "windows"'

    I've searched over google and this forum for 2 days and tried lots of things: qt.conf won't do anything, I've added libEGL.dll and libGLESv2.dll, and qwindows.dll is in the right place, I just can't think of anything else. Another test app just works, but mine doesn't.
    If this changes anything, I'm using a few win32 functions to set hooks and get mouse/keyboard inputs even when my widget hasn't got the focus.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      See if you have QTDIR variable set in your environment. Then make sure you've read the whole "deployment guide":http://qt-project.org/doc/qt-5/windows-deployment.html.

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Angivare
        wrote on last edited by
        #3

        My QTDIR variable isn't set, and I have already read (2 times now :c ) that deployment guide

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          What happens when you put qwindows.dll in <app dir>/plugins/platforms/qwindows.dll?

          Have you run the dependency walker?

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Angivare
            wrote on last edited by
            #5

            putting qwindows.dll in plugins/platforms doesn't change anything, and the dependency walker gives me the following:
            http://puu.sh/6KKos.png
            Though some of the dlls listed here just aren't installed with windows (it's like, version l-1-1-0 is there but not l-1-1-1)

            Well, I eventually moved back to Qt4.8 until this problem is solved.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              What about that IESHIMS.dll there?

              (Z(:^

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Angivare
                wrote on last edited by
                #7

                I have multiple versions of that DLL in my windows directory, and none of them change anything.

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Priya_sipl
                  wrote on last edited by
                  #8

                  Hi Anglvare,

                  Try to add <app dir>/platforms/qwindows.dll instead of <app dir>/plugins/platforms/qwindows.dll and in your release
                  folder add folder platforms/qwindows.dll .

                  Pinnacle_cool

                  1 Reply Last reply
                  0
                  • hskoglundH Online
                    hskoglundH Online
                    hskoglund
                    wrote on last edited by
                    #9

                    That directory "QTDIR/Qt5.2.0/5.2.0/mingw48_32/plugins/platforms" is written into your Qt files when you install it. And as you've discovered, it's not so good on another computer :-)

                    Dependency walker and similar tools are for diagnosing errros with the normal DLLs, but this problem is within Qt itself, when it tries to load its "underbelly" or QPA, i.e. its platform files.

                    Anyway, there are 3 ways to override/specify where Qt's platform files are located: rewrite that hardwired dir in your app's .exe file, add a QT.CONF file together with your app, or add one line in your app's main.cpp to tell Qt where to find the platform files.

                    I think option 3 is the easiest, check out "my blog post":http://www.tripleboot.org/?p=138 where I show you how to add one line to your main.cpp and fix this problem.

                    P.S. I see you've copied only the platforms directory together with the .exe file and the .DLLs. But later on you might need SQLDrivers etc, so I usually copy the whole plugins directory to the target computer. It's a slight waste of harddisk space but much easier to make it work. And then just add that line to your main.cpp and you should be good to go :-)

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Priya_sipl
                      wrote on last edited by
                      #10

                      I tried this but getting the same exception window.

                      Pinnacle_cool

                      1 Reply Last reply
                      0
                      • hskoglundH Online
                        hskoglundH Online
                        hskoglund
                        wrote on last edited by
                        #11

                        Hmm... just checking, you copied the plugins directory (not just the platforms) so that it is together with your .exe file and the .dlls?

                        EDIT: oh I forgot to say. to keep it simple: don't set any QT_DIR or other Qt-flavored environment variables on the target computer. (You can do it but I think it just complicates things.)

                        1 Reply Last reply
                        0
                        • JKSHJ Offline
                          JKSHJ Offline
                          JKSH
                          Moderators
                          wrote on last edited by
                          #12

                          [quote]That directory “QTDIR/Qt5.2.0/5.2.0/mingw48_32/plugins/platforms” is written into your Qt files when you install it. And as you’ve discovered, it’s not so good on another computer :-)[/quote]No, Qt also searches your .exe's subfolders too. You do NOT need to modify qt.conf, or set environment variables, or add code to main.cpp.

                          You just need to copy the files into the correct subfolders. Simple guide here: http://qt-project.org/wiki/Deploy_an_Application_on_Windows

                          Example:
                          !http://i.imgur.com/S582DlV.png(DLL paths)!

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

                          1 Reply Last reply
                          0
                          • hskoglundH Online
                            hskoglundH Online
                            hskoglund
                            wrote on last edited by
                            #13

                            Yes, you're right, I tested with a barebones HelloQt (with no extra line in main.cpp!) and it worked when I copied it to another computer, set up as in your guide, specifically putting the platforms directory next to the .exe file. Good!
                            I think I'll update my blog post!

                            1 Reply Last reply
                            0
                            • JKSHJ Offline
                              JKSHJ Offline
                              JKSH
                              Moderators
                              wrote on last edited by
                              #14

                              Glad I could help. :) Thank you for blogging about Qt and for helping others use Qt!

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

                              1 Reply Last reply
                              0
                              • hskoglundH Online
                                hskoglundH Online
                                hskoglund
                                wrote on last edited by
                                #15

                                Thanks!
                                I'm used to pay money to Microsoft for new Visual Studio releases, but now when I've switched to Qt and can download it for free, I figured blogging etc. is another way to pay.

                                This infamous issue about not finding the windows plugin, it is a challenge to communicate to new users I think. Maybe for the next Qt conference, you can make T-shirts with that dialog box on them :-)

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  Priya_sipl
                                  wrote on last edited by
                                  #16

                                  Thank you JKSH and hskoglund
                                  I tried the same and it worked.

                                  I was facing problem when i was creating the setup for windows using Inno compiler.

                                  When I was including platform dlls with its folder, it didn't include platform folder but instead directly copied qwindows.dll to the installed folder.

                                  In Inno scripts, it was mentioned like this:

                                  Source: "C:\MyQtApp\release\platforms*"; DestDir: "{app}"; Flags: ignoreversion

                                  So I added "platforms" manually so that on installation all platform dll would be copied to platform folder.

                                  Source: "C:\MyQtApp\release\platforms*"; DestDir: "{app}\platforms"; Flags: ignoreversion

                                  Pinnacle_cool

                                  1 Reply Last reply
                                  0
                                  • hskoglundH Online
                                    hskoglundH Online
                                    hskoglund
                                    wrote on last edited by
                                    #17

                                    Good!

                                    BTW, I've updated "my blog post":http://www.tripleboot.org/?p=138 about deploying Qt now, so it's really fancy :-)

                                    1 Reply Last reply
                                    0
                                    • G Offline
                                      G Offline
                                      geoniko
                                      wrote on last edited by
                                      #18

                                      "That directory “QTDIR/Qt5.2.0/5.2.0/mingw48_32/plugins/platforms” is written into your Qt files when you install it"

                                      Can you be more specific? Where exactly is it written too? I need to build x64 windows version of Qt 5.3 for VS2012 (which is not available for download). It would be good to set this correctly so that at least for developers it will work...

                                      Thanks for any advice...

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        Priya_sipl
                                        wrote on last edited by
                                        #19

                                        Hello Geonlko,

                                        “That directory “QTDIR/Qt5.2.0/5.2.0/mingw48_32/plugins/platforms” is written into your Qt files when you install it” means

                                        When we install qt (in this it is Qt5.2.0 mingw 32 bit version) in our system,
                                        all packages get installed with it.

                                        In that packages you will find platform folder that has platform specific dlls.

                                        These are required when we build setup for our Qt application.

                                        For Qt 5.3 64 bit version, you have to go for VS2013, it is available

                                        Pinnacle_cool

                                        1 Reply Last reply
                                        0
                                        • JKSHJ Offline
                                          JKSHJ Offline
                                          JKSH
                                          Moderators
                                          wrote on last edited by
                                          #20

                                          [quote author="geoniko" date="1401351479"]"That directory “QTDIR/Qt5.2.0/5.2.0/mingw48_32/plugins/platforms” is written into your Qt files when you install it"

                                          Can you be more specific? Where exactly is it written too?[/quote]They are written inside the DLLs themselves.

                                          In hindsight, that's a poor decision because it prevents people from moving their Qt installation to a different folders, but changing this behaviour isn't high on the priority list.

                                          [quote]I need to build x64 windows version of Qt 5.3 for VS2012 (which is not available for download). It would be good to set this correctly so that at least for developers it will work...[/quote]When you run configure.bat, set the -prefix option to the path where you want to install Qt.

                                          Then, make sure that your Qt libraries are located in this exact path on each of your developers' machines.

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

                                          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