Solved Qt 5.7 error when starting application after compiled in release mode
-
Hello,
I have an application that compiles fine and runs without problems in debug mode, but whenever I try to run a release mode version (which compiles without errors) I get the following error (Qt 5.7):
This application failed to start because it could not find or load the Qt platform plugin "windows"
in "".Reinstalling the application may fix this problem.
Under Qt 5.6 I don't have any problems.
I already tried adding the bin directory to path, reinstall Qt, adding the folder platforms (with qwindows.dll) to the .exe directory, adding a qt.conf file with the path settings, renaming the Qt directory. Nothing helps.From the error message I would guess that I need to specify the platforms directory somewhere so that "" becomes a valid path. But where do I do it?
QTBUG-54270 addresses a very similar problem (if not the same) but I'm able to compile and run the examples and some small test programs in release mode without problems.
My platform is Win 8.1 with MSVC 2013 64bit.
Thanks for any help in advance!
Thea
-
Try using windeployqt it should fix the problem
-
Thank you for the quick answer! I'll have a closer look later, but from just a first glance: This seems to be great for creating a final deployment version but it doesn't seem to help if I just want to have a small test directly from creator. What I would like as a first step is to be able to click the "run" button in creator and run my program out of creator.
-
@Thea
maybe your QtCreator settings are messed up?
You can close QtCreator, delete the project's .user file to clear the settings, and open up the project again. -
I tried that, but unfortunately it doesn't help. I also tried with and without shadow build and I cleaned and recompiled the whole thing several times. Still, the error remains. But thanks for your suggestion!
-
Ok, I found the problem. I went cleaning my project again and found some Qt5...dlls in my build path. Those were obviously copied from the Qt 5.6 bin and conflicted with 5.7. After replacing them by the corresponding 5.7 dlls everything is fine again. So if somebody else is as scatterbrained as me and runs into this error: What Qt wants to tell you is that you have old dlls in your project that you need to replace with the new ones.
Thanks again for your help and pointing me to the right direction!
-
@Thea Why do you have Qt dlls in your build path?
-
Because the project lies on a server and some computers that use and test the .exe don't have Qt installed. I'm aware that this is far from an ideal setup (struggling with it every day) but there's very little I can do about it.