Unsolved Deploying on Windows fails
-
Hi,
I'm trying to deploy my application on Windows.
After following the steps at https://wiki.qt.io/Deploy_an_Application_on_Windows,
I get the "This application failed to start because it could not find or load the Qt platform plugin "windows"."
I also followed the recomendations at http://www.tripleboot.org/?p=536 and http://www.tripleboot.org/?p=138,
even went to the trouble of the debug viewer.
That last one did not show any more output then the dialogs did (I did set the QT_DEBUG_PLUGINS variable), so I'm a bit lost here.
I included a screenshot of how my dir currently looks like, but it just a copied of the stuff recommended at the first mentioned website.What else can I do to fix this error?
Thanks in advance.
Kind regards,
Remco Poelstra
-
And here is the screenshot:
http://remco.beryllium.net/Capture.PNG -
Hi and welcome to devnet,
You can also use windeployqt to help you prepare the data
-
@remcopoelstra said:
I get the "This application failed to start because it could not find or load the Qt platform plugin "windows"."
- What is the full error message? There are a few more sentences after this.
- Does your app run correctly when you launch it from Qt Creator?
- [EDIT: Question removed]
-
@JKSH
I'm not exactly sure what you mean with a few sentences after that message, so I made screenshots of the dialogs:The app runs fine in Qt Creator, and with the C:\Qt folder available it also runs from the Deployment folder.
@SGaist I'll look into windeployqt, hopefully it will solve the problem
-
@SGaist
I tried using windeployqt, but in the end that gave the same error. -
@remcopoelstra said:
@JKSH
I'm not exactly sure what you mean with a few sentences after that message, so I made screenshots of the dialogs:Thanks; this is the one I meant.
The screenshot tells me that your app couldn't find qwindows.dll
The app runs fine in Qt Creator, and with the C:\Qt folder available it also runs from the Deployment folder.
That means your program is looking for something inside C:\Qt\ that you haven't copied to the correct path in your Deployment folder. I can't see what it is from your screenshot though.
Follow this short tutorial to use ListDLLs: http://kb.froglogic.com/display/KB/Getting+a+list+of+DLLs+currently+loaded+in+a+process#GettingalistofDLLscurrentlyloadedinaprocess-GettinglistofDLLswithListDLLs
- Run your app in Qt Creator
- When the app is running, use ListDLLs to find out which DLLs are loaded
- Close your app
- Launch your app from your Deployment folder
- When the first error dialog appears, use ListDLLs to find out which DLLs are loaded
Compare the two lists from #2 and #5. Which DLLs are missing from #5?
-
Hi,
The short answer seems to be 'none'.
If the DLL's are listed in loading order then there are no missing DLL's before the qwindows.dll.
All DLL's listed after qwindows.dll are available from the Deployment folder (in the imageformats folder and Qt5Svg.dll).
There rest are Windows system dll's.
The files are here:
Creator's DLLs
Deploy DLLs -
Can you past here your main function?
-
Hi, just guessing, but do you perchance have a
qt.conf
in your deployment test directory? If so, delete it. -
I had very similar problem. Finally I found, that problem is in my main function. Check please, if your first object action is creating QCoreApplication or QApplication. I had some lines before it and I get error with qwindows.dll.... I just put them after it and all works fine.
-
That solved the problem!
I had:
QApplication::setStyle("plastique");
QApplication a(argc, argv);as the first lines in main(). Commenting out the first line made the application run!
Many thanks for all the support!
How can I mark this question as resolved?Regards,
Remco Poelstra