[SOLVED] Failed to load platform plugin.
-
[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
-
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>?
-
[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.
-
[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 .
-
qwindows.dll shouldn't be in the same dir as the executable. Put it in the platforms subdirectory.
-
[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
-
[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...
-
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.
-
Hi. I did as you said and it worked! thanks!
welmore