Error during startup.
-
Hello, I am new to QT and I am having an error with running a very simple program. It is giving me an error upon startup.
During startup program exited with code 0xc0000139
I downloaded version 5 and installed the package "here ":http://qt-project.org/downloads for MingGW
Any help is appreciated.
-
Here is what I get when I try to run the program from the executable
!https://dl.dropbox.com/u/4177525/gameerror.jpg(Game Error)!
-
Your exe has to be deploy with dependencies dll's. libstdc++-6.dll is library from mingw. Run Dependency Walker and check what dll you need deploy with exe and copy it to same folder where you have the exe. dlls you will find in lib and probably bin folders from Qt SDK.
-
Seems like it's missing two dlls. I haven't made any changes to the program but I assumed that if I ran it I would just get an empty window.
!https://dl.dropbox.com/u/4177525/gameerror2.jpg(Error 2)!
It doesn't run from QT Creator or by manually running it. Where do I get these files and how do I add them?
-
According to your screenshot, you are not missing two DLL's, but only one (referenced twice) has a problem.
Also, from your error message, it seems that you do NOT miss "libstdc++6.dll", but an incompatible version was used and that one is lacking a required entry point! Thus the application won't start.
This usually happens when you do NOT properly deploy the suitable DLL that your application was built with (for), but some DLL of the same name happens to be found somewhere on the user's system (e.g. in "Windows" or "Windows\System32"). So, at runtime, the "wrong" DLL is being used. Make sure that you always deploy all the required DLL's and that you put them directly into the "install" folder where your EXE file is located!!!
BTW: libstdc++-6.dll should be located in the "bin" folder of your MinGW installation. If there are multiple MinGW installations on your system, make sure you pick the DLL from the one that you used to compile your EXE!
-
I am not sure which dlls my application was built for. It's just the default QT program, which I expected to open and make a window.
I found the dll in a MingGW folder and copied to System32 and the QT creator MingGW. I then cleaned and rebuilt the entire application, but it is still throwing the error.
-
Please do not copy any application-specific DLL's into the "System32" directory - or into any other system-wide directory! Doing so will lead to the problem known as "DLL Hell". And it's actually exactly what you are experiencing right now: The program will load a "wrong" DLL at runtime, just because a DLL that happens to have the same name as the required DLL (but is not the required DLL file!) happens to be located in one of the "system-wide" directories. Instead you should ALWAYS deploy the required DLL's directly into your app's install folder (i.e. where your EXE file is located), so [1] you can be sure that your application will load the correct DLL at runtime and [2] you can be sure that you don't compromise any other applications.
BTW: If you compiled the app yourself, you know what MinGW you used to compile it and you should be able to grab the right DLL from your MinGW installation folder. If you got the app as a pre-compiled binary, it should have shipped with the right DLL. If not, it will be hard to figure out what MinGW version had been used to create it...
BTW²: Dependency Walker has a very useful option to show the full path of each DLL file. Use it!
--
Also keep in mind the DLL search order:
[quote]1. The directory from which the application loaded, i.e. where the EXE file is located
2. The system directory (e.g. C:\Windows\System32)
3. The 16-bit system directory (e.g. C:\Windows\System)
4. The Windows directory (e.g. C:\Windows)
5. The current directory
6. The directories that are listed in the PATH environment variable[/quote]