Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error in release mode: The program has unexpectedly finished.



  • When I run my code in Qt in Debug mode, it works correctly. But it does not work in release mode.
    The following message displays: "The program has unexpectedly finished. D: \ Engineering \ DyBlend1.2 \ release \ DyBlend4.exe crashed."
    Already searched in other topics but I not find the solution.
    Anyone have any ideas?
    I use MinGW



  • Any other information? What does the debugger say about where or what crashed?

    I had a somewhat similar problem using VC++ (ver 6) back in the old days. I could only compile this one particular program for debug build as release build would crash the compiler (only message I got from the crash was to contact Microsoft and report the error - bleh!). It turns out it was a very subtle mistake in an inline function; it took me a long time to find it.



  • I am not sure about MinGW,
    but if it was VC I would say 90% of release only errors are
    lack of initialization.
    In debug memory is always initialized to 0. When in release it is not.



  • I very much doubt it is MinGW. I have used many versions of this for quite a few years now and never had this issue.

    Lack of initialization makes sense.

    Another possibility is some optimization is done that has a detrimental effect on your program. This is rare but I have seen one example of this (in my case it was related to a loop - needed to use the keyword 'volatile' on one of the variables).


Log in to reply