Qt The application was unable to start correctly (0xc000007b) - qt

Am trying to compile project found at uconfig, I managed to compile the application successfully using 32bit version mingw, yet when I run the .exe I get this error The application was unable to start correctly (0xc000007b), I moved all the required DLLs required to exe path but still getting same error,
on the other hand, the application starts in debug mode in Qt creator normally

After searching ... the reason was I had another verion x64 of Qt installed and /bin was added to system path. this resulted in conflict between DLLs generated from Qt and ones found in the System path

I fixed the same problem by running them as adminstrator (properties/compatability/Run as Admin)

Related

QT Creator cannot find "objbase.h" when invoking nmake

When attempting to build my Qt project with MSVC2015 64bit for Windows 10, I get this error:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\Ole2.h:37: error: C1083: Cannot open include file: 'objbase.h': No such file or directory
...
NMAKE:-1: error: U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.EXE"' : return code '0x2'
NMAKE:-1: error: U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\nmake.exe"' : return code '0x2'
-- when nmake is invoked during the build process.
This exact same error also occurs for the example project "addressbook".
It appears to be some kind of toolchain issue, but I can compile a Qt Widget project in Microsoft Visual Studio 2022 if I point VS at my Qt installation.
I'm not sure what I need to do from here, since I already tried a reinstall of Qt. I have seen that putting things in Program Files is generally a bad idea, but that doesn't seem to be the issue in this specific case.
It appears to be part of the Windows SDK, if Google leads me right. However, I did not have to download the Windows SDK separately in order to compile my project and run it successfully before. (For context, the project's been developed for a few months and this problem only emerged a week or so ago).
My QT Installation:
Kit: Desktop Qt 5.15.2 MSVC2015 64bit
Version: Qt 5.15.2 MSVC2015 64bit
Compiler: Microsoft Visual C++ Compiler 17.3.32811.315 (amd64)
Things That Have Happened Before My Build Attempt:
I recently reinstalled Qt 5.15.2 in an effort to resolve a similar missing file issue.
The company's recently had issues with Microsoft Intune deleting applications. Maybe it hit the Windows SDK too.
Attempts at Solving the Issue
Reinstallation of Qt 5.15.2
Expected: My project building without errors. Result: This error.
Search of file system for objbase.h
Expected: Finding the file. Result: I did not find the file.
I'm newish at Qt, so I didn't want to try anything more esoteric lest I made things worse than before.
Update: MinGW 64 bit works for the example Qt projects, but I'd still like to use MSVC2015 if possible. It doesn't work for my project because I use some MSVC specific pre-processor flags in my source.
Update 2: I attempted to re-download MSVC 2015 from Visual Studio's website, using their Build Tools installer. While the installation successfully finished, I got no change from before -- it still can't find that "objbase.h" file. It's supposed to be in the Windows Kits directory under Include//um , I think.
It appears that, in my case, the objbase.h file was deleted due to the issue with Windows Defender deleting random files. I was able to reinstall the version of Windows SDK that was using and this fixed the issue for me.
I figured it out. I'm posting the solution here for others.
My issue was that, for reasons that are unclear to me, VS Studio Build Tools would not actually remove the SDK in question if I unchecked its box in the Modify screen. You can tell if this is happening by checking the disk size difference of the upcoming installation in the lower right of the screen -- if it won't remove the SDK, that size will be +0 bytes (assuming you don't check or uncheck any other box).
In order to properly reinstall the SDK version, I had to go to "Add or remove programs" and find the SDK there, uninstall it, restart my computer just for safety, and then go to VS Build Tools and install that SDK version. I had to do a "fake" uninstall with VS Build Tools (basically, uncheck the now-deleted SDK and click "Modify", allowing it to do the installation and download steps) before I could actually install the SDK again.

error while execution of qt .exe file using windeployqt

I have a problem with my qt deployment under windows 10. I'm using QtCreator 4.5.1 and Qt 5.11 on Windows 10. I execute my application in release mode. Then I open the command line by running Qt5.11.0 for Desktop(MinGw 5.3.0 32 bit). There I give the path of the release folder (where my exe file exists):
C:\Qt\workspace\build-CanSaveLog2FilterError2DataExploreClass6-Desktop_Qt_5_11_0_MinGW_32bit2-Release\release
After that I type this line:
windeployqt.exe --quick .
and all the necessary .dll files and platforms and plugins will be generated.
When I do this to a simple qt project, it works fine and my exe file can be executed correctly. Whereas when I do the same to my desired project, I can't execute my exe file and I get this error:
This application failed to start because it could not load the Qt platform plugin "windows"
in "", even though it was found. This is usually due to missing dependencies which you can find by setting the env variable QT_DEBUG_PLUGINS to 1.
Available platform plugins are: windows.
Reinstalling the application may fix this problem.
I tried to find dll file by executing it in dependency walker. When I did this, it showed a lot of dll files missing such as "API-MS-WIN-EVENTING-CONTROLLER-L1-1-0.DLL" which doesn't exist even in bin folder of mingw. While if I put the exe file in the bin folder of mingw it works fine.
So I tried to find all the main dll files whose their sub dll files were missing and copied them to the release folder. For example for API-MS-WIN-EVENTING-CONTROLLER-L1-1-0.DLL, I copied Qt5core.DLL to the release folder. But it didn't work again.
I can't understand where the problem is. Could you please help me to resolve it? Since yesterday morning I'm searching and can't find the solution.

QT exe file doesn't appear to run

I wrote a program in Qt:
Qt Creator 3.5.1 (opensource)
based on Qt 5.5.1 (MSVC 2013, 32 bit)
Windows 8.1 64-bit
My program is running fine in Qt creator.But I want to execute it in other computers on all Windows without installing Qt. I copied all required .dll files next to the .exe file (Release build) with windeployqt.exe.
When I start the.exe, nothing happens.
No GUI showing up, no error that a .dll is missing. But I see my application in 'ProcessExplorer'.
This happen for even very simple program.
Here's a screenshot of my Dependency Walker screen for simple application:
I had exactly the same problem and as you, I had no error message or any output whatsoever. I solved the issue when I added the QML path to my deployment.
On this page, windeployqt, you will see the commmand:
windeployqt --qmldir < path-to-app-qml-files> < path-to-app-binary>
Here the command with the qml flag.
C:\Qt\5.10.1\mingw53_32\bin\windeployqt.exe --qmldir C:\My_project C:\My_project\build-My_project_MinGW_32bit-Debug
It seems you are using QML.
did you have a look at stdout / stderr? I have had that problem when my QML file was not loadable / path was incorrect.
Also settings environment variable QML_IMPORT_TRACE=1 helped me to spot these kind of problems.

static linking of standard QT libraries

I am trying to build an QT application with version 5.4.
and when ever I am trying to run the exe on a different machine where QT is not installed I am getting below error "The program cannot start because QT5core.dll is missing from your computer, Try reinstalling the program to fix this problem".
and when I copied QT5core.dll with the exe in a machine where QT is not installed its working fine.
Is there any way that I can link QT5core.dll with the exe statically so that whatever place I run this exe it should not ask for any dll.
Thanks,
Tushar
You can build a standalone version of your Qt application so that it doesn't have any library dependencies at runtime. Be warned though: this can greatly expand the size of the .exe generated and the compilation time. Have a look here:
https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows
and here:
https://wiki.qt.io/How_to_build_a_static_Qt_version_for_Windows_with_gcc

.exe not running through QtCreator and from outside in Qt 4.8.1. issues regarding dll

I have Qt 4.8.1 installed on a windows 7 64 bit OS. I am using opencv and Qt together for my project.
For opencv dll's i gave the necessary path and everything in .pro. Everything was working fine until yesterday.
My code gets compiled successfully, but now when i run, it says that abc.exe executed with code -1073741511.
When I manually run the .exe file from debug or release folder it says that some entry point could not be located in QtCore4.dll.
I tried everything, from setting the Qt & opencv Dlls in %PATH% environment variable to copy and pasting the dlls to the same folder to that of .exe
i hav seen the .exe through dependency walker also and it shows me red color in Link checksum field of QtCore4.dll.
Can anybody help me on this?????
Make sure you are not using (by using i mean copy/add to path) a wrong dll, i mean a dll that was built with a different compiler, example the default (MinGW version) SDK has two versions of QtCore.dll: the correct one (built with MinGW): QT_INSTALL_PATH/qt/bin and one built with some version of VS: QT_INSTALL_PATH/bin (this one is used by Creator and other tools)

Resources