Qt platform plugin found yet not found
-
Hi guys,
I have in the past successfully deployed an app on Windows, however, as I was trying to compile an updated version of my app, I ran into a problem I couldn't solve:
First, the app compiles fine, no linking errors or anything. I copied all the required DLL's into the same folder as the exe-file, and added the subfolder sqldrivers/, imageformats/, and platforms/ with all of their content.However, whenever I attempt to start my application I get the following error message:
The Application failed to start because it could not find or load the Qt platform plugin "windows". Available platform plugins are: minimal, windows Reinstalling the application may fix this problem.
Searching the internet, I found numerous forum posts where people ran into this problem, however, they usually forgot to add the platforms subfolder. In my case, the "windows" plugin is found, but for some reason fails to load.
I compiled my app using the mingw-w64 compiler (I cross-compiled from Linux). I had also tried to compile my app using Cygwin on Windows, but ran into the equivalent error (only that there the missing plugin was called "xcb", which was also listed as available).
I'm really out of ideas what to try. All the required dll's are there, but the platform dll doesn't seem to be loaded although it is found... Anybody any idea what I could try?
Compiler: mingw-w64 (on ArchLinux)
Qt Version: 5.4.2
Tested target OS: Windows 7, 64Bit -
MinGW might have added some dependency to your dll that you're not aware of. Use this tool:
http://www.dependencywalker.com/
and check whether you really got all dependencies on Windows.
-
Thanks for the reply, Leonardo!
I actually used dependency walker (forgot to mention that), and it does find two delay-load dll's that are missing (GPSVC.DLL and IESHIMS.DLL), but according to what I found online, they are commonly missing and usually don't have any effect (and certainly not at startup, since they are delay-load)... Other than that, all dependencies seem satisfied.
-
What do you mean by "other dependency for qwindows.dll"? I only have that one, in the platforms subfolder. Copying it into the exe folder doesn't change anything...
However, I noticed something:
In the platforms/ subfolder, I not only have qwindows.dll, but also libqwindows.a (I simply copied the folder over and it was in there). If I delete the libqwindows.a file, my exe still crashes, but it does so 'silently', i.e., no error is displayed (only the Windows thingie that it stopped working)...Do I maybe need a certain *.a file for it to work? I don't really think so (as dll's should be enough), but I start to wonder...
What I did now, was to try and go overkill: I copied all the dll's I have in my /usr/i686-w64-mingw32/bin folder and all the folders inside qt/plugins into my exe folder, yet I still get the same crash... So the problem must lie somewhere else - but where?
-
I use mingw32 on Windows and sometimes my binaries depend on "libgcc_s_dw2-1.dll", for example. That's what I meant. If that were your case (but it's not), you could have this file inside the "platform" folder. Then Dependency Walker would say it's ok, as it's in the same folder, but it wouldn't work with Qt, as it would search for it in the exe's directory.
The .a file is for linking. It has nothing to do with your problem, even though you're reporting some unexpected behavior.
Would you mind uploading your dll somewhere, so I can have a look at it?
-
Sure, you can find it here: http://photoqt.org/qwindows.dll
Thanks a million for your help, by the way!
-
The dll LIBGCC_S_SJLJ-1.DLL exists in the exe folder, so it should find it...
Tomorrow, I'll try to get another distro set up in VirtualBox (prob OpenSUSE, they have all mingw packages in a repository), maybe I get better results with slightly different versions of stuff. They also seem to still have mingw32 in their repositories.
-
Okay, so I installed OpenSUSE in VirtualBox, installed mingw32, compiled my app, copied the exe and all the dll's to Windows 7, double clicked the exe - aaaaand:
It crashes right away, without any error message :/
The problem seems to be once again in the qwindows.dll, because I do get the same error message as before when I remove the platforms subfolder... If it helps, I uploaded the qwindows.dll to the same file as before: http://photoqt.org/qwindows.dll
-
@aran said:
Well, compiling Qt from source would be the next step. For mingw32 I used the rpm's that are in one of OpenSUSE's repository. My app, however, compiles and links without errors, I just cannot run it.
There are many different "builds" of MinGW out there. Unfortunately, not all are compatible with each other. If you use a build that is incompatible with the one which was used to compile Qt, then you will run into trouble.
See https://wiki.qt.io/MinGW to help you find a compatible build.
Alternatively, use the same copy of MinGW to compile Qt AND your app.
-
Well, of course I used the same copy to compile both Qt and my app. However, building the base Qt5 package (the one that is responsible for the qwindows.dll) from source didn't change anything...
Thanks for the link! I will give that a go with a fresh setup, however, right now I'm unable to download anything from sourceforge, it always throws me back to the file overview (tried it in different browsers and OS's)... I guess I'll have to try later as there doesn't seem to be a different mirror :/
-
@aran said:
Well, of course I used the same copy to compile both Qt and my app. However, building the base Qt5 package (the one that is responsible for the qwindows.dll) from source didn't change anything...
Hmm... in that case, it's time to try everything. Follow the instructions under "Initial deployment (Quick and dirty)" at http://wiki.qt.io/Deploy_an_Application_on_Windows
-
Okay, I got a partial success:
I downloaded the Qt installer for Windows, and during installation selected the right mingw compiler version (as per https://wiki.qt.io/MinGW). Now, I'm able to compile my app in QtCreator and it also runs. Well kinda. At first, it ran (i.e., it produced command line output and was shown as 'running') but the main window wasn't visible. Besides the expected output on the command line, I got a bunch of OpenGL warnings.
After installing Direct3D support in VirtualBox and enabling it in the settings, I'm now able to start the app, though nothing else really works. But as I found online, this is due to VirtualBox not having proper support of OpenGL. That means, that I will have to pass a completely untested installer to my users, but at least there's something.I will try to get a proper cross compiler on Linux running, using the right mingw version and installing qt entirely from source. I know now, that it should work, so hopefully that'll be successful! I'll report back...
Thanks to everybody who helped me so far!
-
Hi. I have a Qt Quick application that runs perfectly inside VirtualBox. You should enable ANGLE on Qt. It's much more reliable when deploying for Windows.
http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
-
Hm, that's strange, that doesn't work for me... Although at your link it says that "As of Qt 5.5 this [dynamic opengl] is the configuration used by the official, pre-built binary packages of Qt.", if I set the QT_OPENGL environment variable to 'angle', my app still crashes...