[SOLVED]Failed to load platform plugin "windows"
-
I finally got both the debug and release versions of the applications working from Qt and from the folders when the appropriate DLL's are copied. However, as you have said, Qt doesn't want to auto-detect anything.
These are the environment variables I found relating to Qt in the projects tab on the left:
PATH: C:\Qt\5.3\msvc2013\bin
QTDIR: C:\Qt\5.3\msvc2013I found no environment variables relating to MingW (I do have it installed, though). More confusing, why doesn't the application run from Qt when clearly the path to the Qt version is set without the copied DLL's?
-
I finally solved that problem too!
Thank this thread: "Fix":http://qt-project.org/forums/viewthread/29372So to get the application to be run from Qt without copying DLL's over, you will have to add an environment variable to the project's settings. Note that I'm using msvc2013 in this example, so replace that with what you are using. Here are the baby steps on doing this:
- Head over to the projects tab on the left
- On the top you will see the kit(s) you are using to build the project with. Click on run (which is right next to "build"). This will bring you to a similar, yet a little different page.
- Scroll down until you see Run Environment
- Click on details on the right to expand the section
- Click on the add button on right
- Type or Copy/Paste QT_QPA_PLATFORM_PLUGIN_PATH as the variable name on the lest column.
- In the right column, type in the directory in which you platform is in. In my case, it is "C:\Qt\5.3\msvc2013\plugins\platforms".
- Run the project
Edit: For step 7, "$(QTDIR)\plugins\platforms" should be able to automatically point to the needed directory. Thank this thread: "link":http://qt-project.org/forums/viewthread/26001
If you are getting any errors relating to DLL's or something like so:
"The instruction at 0×5b175f0d referenced memory at 0×00000000. The memory could not be read.
Click on OK to terminate the program"
Then you probably don't have an environment variable pointing to the bin directory of the compiler you are using.I wish the process would have been simpler. hskoglund, perhaps you might include this in your blog as well?
-
Hi, it's in "my blog":http://www.tripleboot.org/?p=536 (scroll down to bonus contents) but I had a spelling error: -QT_QPA_PLUGIN_PATH- fixed now.
Good it worked for you, but using QT_ QPA_PLATFORM_PLUGIN_PATH I think has 2 disadvantages:
- If your app depends on other plugins/subdirectories, for example imageformats or sqldrivers, then this environment variable has no effect
- if you deploy your app to another computer then you must remember to set the environment variable on that computer as well.
-
hskoglund - that last comment really helped me out! I was changing Qt versions, copied my DLLs (including Qt5Cored.dll) to the deployment target location. After a while I needed to reinstall the Qt version and I didn't have a clue why it wouldn't work - until I read your comment about the installer's change.
-
I have also had headakes with my app which worked in Qt Creator and on my computer but not on other computer.
The problem was that I was not using the correct qwindows.dll. I used the version from P:\Qt\Qt5.1.1-mingw\Tools\QtCreator\bin\plugins\platforms.
The correct version is in P:\Qt\Qt5.1.1-mingw\5.1.1\mingw48_32\plugins\platforms
As hskoglund said, you should'n probably use dlls from qtcreator folder. -
Hello,
I have a similar problem. I've read some stuff, but nothing works for me.
I've deploy my application with windeployqt (Readed here and here). On my PC the solution works fine. Another PC has following error message:
This application failed to start because it could not find or load the Qt platform plugin "windows". Reinstalling the application may fix this problem.
Following steps I've tried:
-
Created with platforms sub-folder. The error message was extended in this case to:
This application failed to start because it could not find or load the Qt platform plugin "windows". Available platform plugins are: minimal, offscreen, windows, windows., Reinstalling the application may fix this problem.
-
Used dependency walker for checking the dlls.
IESHIMS.DLL -> also missing on my PC SHLWAPI.DLL IEFRAME.DLL -> this one is the deley-load depenceny (see error message below) Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Copying the ieframe.dll from C:\Windows\System32 to release folder will also not fix it.
-
Checked this. No success.
-
Trying to add to main.cpp
QCoreApplication::addLibraryPath("./"); QCoreApplication::addLibraryPath("./platforms");
No success.
-
Also checked this thread.
-
Also tried to add libEGL.dll to the package. No success.
I developing on Windows XP with Qt 5.4 and MinGW 4.91 32 bit compiler. Some test PC's are Windows 7.
Has anyone hints for me? The message "no windows plugin. Available plugins windows, windows" is also strange.
-
-
Hi,
@Saved said:
The message "no windows plugin. Available plugins windows, windows" is also strange.
That means your program found the qwindows.dll plugin, but could not load it. Usually, it's because a dependency is missing. Follow https://wiki.qt.io/Deploy_an_Application_on_Windows carefully.
-
@Saved said:
Thank you JKSH for your fast reply.
I've pointed out that my app works fine on all systems with platforms sub-folder expect my usual test environment in a VM.
Regards.
You're welcome.
I'm not quite sure where you're at now: Are you still facing the same problem? Have you followed the wiki instructions for your VM?
-
I have tried all these solutions on a new windows 10 machine and nothing has worked yet. I have migrated some old Clipper code to Harbour with QT. I was able to compile and run it fine on an XP machine. When I moved the executable folder from the XP machine to the Win10 machine, the program still ran fine. After I compile it on the Win 10 machine, it no longer runs. Obviously, something in the build process is not working correctly.
-
Hi
" After I compile it on the Win 10 machine, it no longer runs. "It's a bit unclear what stopped working. When you compile
on win 10, it will not even run in Creator?
Or do you mean run from deploy folder?
(standalone)