Program runs from Qt Creator in release mode, but not from the executable
-
wrote on 15 Aug 2022, 19:50 last edited by SGaist
I have a program that compiles and runs correctly from Qt Creator in both debug and release mode. However, if I try to run the executable, I get this error:
The application was unable to start correctly (0xc000007b)
I've run windeployqt but it didn't solve the problem.
My compiler is MSVC 2019 32-bit. I'm using Windows 10 and Qt 5.15
From what I've read, it looks like my issue is due to a conflict between 32-bit and 64-bit architectures. If this is the case, how can I check which of my libraries might be causing the conflict? -
You can load your app in Dependencies and it will show you everything your app is depending on and trying to load. Maybe you have a dll dependency that gets pulled in because of polluted PATH or system directories.
Btw. Just out of curiosity - why are you making 32bit app for Windows? Is significant portion of your users still on 32bit systems?
-
wrote on 17 Aug 2022, 15:24 last edited by
Thanks, @Chris-Kawa .
I've just run Dependencies and added the dlls that were missing. However, now I get a different error when I try to run the program:qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Is there any way to make it work without reinstalling?
I'm making 32bit app for Windows because I use a dll from a 3rd party company and it doesn't work with 64bit.
-
It means you're missing a platform plugin in your deployed app directory. That's weird. windeployqt should copy it for you.
Anyway, your app directory should look something like this:[your app dir] YourApp.exe Qt6Core.dll ... //other dlls [platforms] qwindows.dll [styles] qwindowsvistastyle.dll
You need at least the platforms plugin dll for your app to work. You'll also need the styles dll if you use any gui. You will find them in your Qt installation directory in plugins directory. There are more dlls there e.g. database and imageformats plugins if you use any. They should be deployed along your exe in subfolders named the same as in the plugins directory.
I'm making 32bit app for Windows because I use a dll from a 3rd party company and it doesn't work with 64bit.
Ah, I get it. It's a shame this still happens in this day and age :(
-
wrote on 18 Aug 2022, 15:45 last edited by
I managed to solve the problem by reinstalling Qt on my computer. Thanks for the help!
1/5