Fresh install of Qt Creator can not run demo application in release mode
-
I have been fighting this problem for a while now but again last night tried uninstalling all previous installations of Qt and downloaded and installed the latest and greatest. I tried building the broadcastsender example and it runs fine in debug mode. When I switch to release mode and try to run I get the 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.
After I close that error I get the following error message:
Microsoft Visual C++ Runtime Library: Runtime Error! This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
If I copy the plugins folder into the release build directory it will run without an issue. That is fine for deployment, however it should not be required when running the application in release mode through Qt Creator. I tried updating my PATH to include the plugins directory, but that didn't help. I also tried many of the somewhat related posts in the forums with no luck...
I am running Qt Creator 4.7.0 based on Qt 5.11.1 (MSVC 2015, 32 bit)
I am compiling the test program with the Qt 5.1.1 MinGW 32 bit libraries
Thanks
-
Hi @mgilorma, first let's check what DLLs your Release build is trying to load.
- Try to launch your app
- When the popup dialog appears ("...could not find or load the Qt platform plugin..."), leave it open. Don't close it.
- Use ListDLLs to show all the DLLs that have been loaded into memory.
Which folder(s) is your application loading Qt DLLs from?
@mgilorma said in Fresh install of Qt Creator can not run demo application in release mode:
I tried updating my PATH to include the plugins directory
Please avoid adding folders to your PATH if you can avoid it. This is the root cause of numerous similar problems.
-
The ListDLLs application shows that a debug build seems to load the required plugins while the release build does not. (I tried to upload the txt files of the output but am not sure how to do that right now)
This is a problem with this particular laptop as I loaded the same version of Qt onto another laptop and do not have the same issue... The frustrating part is that uninstalling and reinstalling does not seem to help...
-
Hi, perhaps some debris remaining from previous Qt versions are causing problems for your release mode plugins to load.
You could check by turning on a trace for the plugins loading, in Qt Creator, go to the Projects pane, add QT_DEBUG_PLUGINS as a new variable to the Build Environment, and set its value to 1, like this:
Then, in Qt Creator, launch your release mode app again, now you should see lots of "QFactoryLoader::QFactoryLoader() looking at ..." and similar output. Scroll down to where the output ends...
-
@mgilorma said in Fresh install of Qt Creator can not run demo application in release mode:
The ListDLLs application shows that a debug build seems to load the required plugins while the release build does not.
I'm more interested in the "main" DLLs like Qt5Core.dll, not the plugins.
And most importantly: Which folder(s) (give absolute paths!) are those main DLLs taken from?
(I tried to upload the txt files of the output but am not sure how to do that right now)
The easiest way is to copy+paste the text straight into this forum. Put triple backticks (`) before and after the text to put them in a scroll area.
This is a problem with this particular laptop as I loaded the same version of Qt onto another laptop and do not have the same issue... The frustrating part is that uninstalling and reinstalling does not seem to help...
I'm guessing it's something in the environment of this laptop. ListDLLs and @hskoglund's plugin debugging technique should reveal something.