Congratulations to our 2022 Qt Champions!

GUI Application crashes before launch

  • Hello Qt Forum,

    Not too long ago I was working with qt-opensource-windows-x86-mingw492-5.5.0, in a windows 7 64bits platform. It was working very good using OpenCV.
    I dropped that work and start over on this week. My past development is not runneable... the code compiles correctly but the application never starts. I did many things in this couple of months, so I'm not sure if I installed something that prevents the default configuration to work as it used to.
    I try to run a basic default GUI application and I get the log:
    The program has unexpectedly finished
    I've also try to debug it but I got an error:
    program exited with code 0xc0000139

    For what I read, this has something to do with the QT configuration pointing to a compiler that could be duplicated.
    How can I be sure that this is the issue than I'm engaging?
    What can I do to configure QT with the appropriate compiler and ignore any other compiler installed in my PC?

    I'd very appreciate any support on this.

    Raul C.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt are you using now ?
    What compilers do you have installed ?
    Did you try to run your application through the debugger ? If so, what's the backtrace ?
    Did you also check in the Run part of the Project panel that the folder to OpenCV's dlls are listed there ?

  • I've just installed the Qt Creator 3.4.2 (opensource)
    Based on Qt 5.5.0 (MSVC 2013, 32 bit)
    I'm using cygwin and also greenhills, and many other programs might be using portable versions of mingw.
    Using the debug mode I get this message:

    The compile output is this:
    17:55:39: Running steps for project untitled3...
    17:55:39: Configuration unchanged, skipping qmake step.
    17:55:39: Starting: "C:\Qt\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe"
    C:/Qt/Qt5.5.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Users/RCastanon/Documents/test/build-untitled3-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    mingw32-make[1]: Nothing to be done for 'first'.
    mingw32-make[1]: Leaving directory 'C:/Users/RCastanon/Documents/test/build-untitled3-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    17:55:40: The process "C:\Qt\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited normally.
    17:55:40: Elapsed time: 00:01.

    I get this warnings:
    Warnings while parsing QML type information of C:/Qt/Qt5.5.0/5.5/mingw492_32/qml:
    <dump of C:\Qt\Qt5.5.0\5.5\mingw492_32\qml>:1:24: Reading only version 1.1 parts.
    <dump of C:\Qt\Qt5.5.0\5.5\mingw492_32\qml>:10:5: Expected only Component and ModuleApi object definitions.

    And finally this is the application output:
    Starting C:\Users\RCastanon\Documents\test\build-untitled3-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug\untitled3.exe...
    The program has unexpectedly finished.
    C:\Users\RCastanon\Documents\test\build-untitled3-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug\untitled3.exe crashed


  • Lifetime Qt Champion

    @luisrcastan And did you try to run your app through debugger as @SGaist suggested?

  • Hi @jsulm

    Yes, sorry if i didn't explain correctly.

    Using the debug button in the IDLE, the 0xc0000139 error code appear, and in the application output windows prints:

    Debugging starts
    Debugging has finished

    The compile output window prints:
    09:43:39: Running steps for project untitled4...
    09:43:39: Configuration unchanged, skipping qmake step.
    09:43:39: Starting: "C:\Qt\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe"
    C:/Qt/Qt5.5.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Users/RCastanon/Documents/test/build-untitled4-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    mingw32-make[1]: Nothing to be done for 'first'.
    mingw32-make[1]: Leaving directory 'C:/Users/RCastanon/Documents/test/build-untitled4-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    09:43:39: The process "C:\Qt\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited normally.
    09:43:39: Elapsed time: 00:01.

    This was only when I try with the debug mode button.

    Raul C,

  • Lifetime Qt Champion

    Do you have any external dependencies for your application ?

  • Hi @SGaist,

    What do you mean by external dependencies?

    At the beginning I've tried to run the project that I've worked long time ago, but after I haven't be able to do it I try to run a bare new one.

    Right now I'm trying to run a default project, the one that is created by default when we create a new project:
    New->Project->GUI application...

    Thanks again

  • Lifetime Qt Champion

    By external dependencies I mean any library that you are using in your application.

    Do you mean that even a default project doesn't start ?

  • @SGaist ,

    That's correct, a default project does not start...

  • Lifetime Qt Champion

    @luisrcastan Create a console application and check whether this one starts. If it does then most probably it is an issue with your graphics driver.

  • Hello @jsulm

    I've created a new project and it seems to work properly...
    But when I added a simple code like
    unsigned int x;

    and I set a breakpoint in x=1;

    The next messages pop out:

    If I have to guess.... i think I'm not using the right compiler, because the compilation does not set any kind of error, but the exe file does not run properly.

    How can I know that I'm using the right compiler?

    Thanks for your support

  • Lifetime Qt Champion

    @luisrcastan What happens if you start this app without debugger (Strg-R)?

  • Hi @jsulm ,

    At first look seems like it is working correctly, but as I see, the instructions do not execute.
    With a new project I added a simple printf("Hello word"); then the system("PAUSE"); instruction.
    The application output shows:
    The console application window does not print anything:


  • @luisrcastan
    This is guesswork, but if it were me because of where it falls over and the random exit code I would be checking:

    1. Are you sure the program is finding the correct versions of MinGW C runtime startup library (and standard libraries), and that those are the versions matching what is expected at compilation time?

    2. Does it make any difference if you compile not-for-debug?

    3. Have you tried running your program not from inside Qt Creator?

    4. Take your "Hello world" program and compile it as a standalone C/C++ program quite outside of anything Qt, using the same MinGW compiler. How does that behave?

  • Hello guys,

    Since I thought this was related to some internal configurations, what I did is to clean my PC, I uninstalled all the application that I'm not using currently, cleaned all the frameworks and all visual studio versions.
    After this clean up, I install QT and the application is running without any problem.

    Thank you all for your support.

    Best regards
    Raul C.

Log in to reply