Results 1 to 9 of 9

Thread: Release Mode Compiler Terminated with a Terrible Exception

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Release Mode Compiler Terminated with a Terrible Exception

    OK, my application works fine now, but when I try to build it in release mode, the compiler terminates with an error. It says an unknown software exception occurred. That really stinks because I was just about to put the final executable with the dlls and see how it runs.

  2. #2
    Join Date
    Jan 2006
    Location
    Shanghai, China
    Posts
    52
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    it's probably caused by accesses to some unexpected addresses (e.g. index of array out of range)
    debug version usually doesn't have a so strict mechanism as the release version
    please do more checks to your code
    1. Users don't have the manual, and if they did, they wouldn't read it.
    2. In fact, users can't read anything, and if they could, they wouldn't want to.

  3. #3
    Join Date
    Dec 2009
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    Quote Originally Posted by bood View Post
    it's probably caused by accesses to some unexpected addresses (e.g. index of array out of range)
    debug version usually doesn't have a so strict mechanism as the release version
    please do more checks to your code
    I don't understand. Wouldn't an index out of range cause a runtime error, something that can only occur during the execution of the compiled program? I didn't even get the program built yet. The compiler itself terminated before it was built. But it works fine in debug mode.

    g++.exe terminated, saying, "The exception unkown software exception (0x40000015) occurred in the application at location 0x0040ec01. Click ok to terminate the program. Now I don't understand how my code could have caused that. But I know you are more experienced and know more. So I just need help understanding what's wrong here.

  4. #4
    Join Date
    Dec 2009
    Posts
    19
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    What version of gcc are you using (MinGW or Cygwin, and what version exactly)?
    Is there anything that compiler outputs before this error occurs?
    What version of Qt are you using?
    Please write the exact procedure you do to compile your program (commands you enter) if you are using command prompt.

  5. #5
    Join Date
    Dec 2009
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    I'm using Qt 4+ and whatever compiler comes with QtCreator.

    1. I load my project in Qt Creator
    2. I click Build > Set Build Configuration > Release
    3. I click Build > Build All

    Then it says this:
    Running build steps for project Learning...
    Starting: C:/Qt/2009.04/qt/bin/qmake.exe C:/Users/Guido/Documents/Learning/Learning.pro -spec win32-g++ -r CONFIG+=release
    Exited with code 0.
    Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe -w
    mingw32-make: Entering directory `C:/Users/Guido/Documents/Learning'
    C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/Users/Guido/Documents/Learning'
    g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\2009.04\qt\include\QtCore" -I"..\..\..\..\Qt\2009.04\qt\include\QtGui" -I"..\..\..\..\Qt\2009.04\qt\include" -I"..\..\..\..\Qt\2009.04\qt\include\ActiveQt" -I"release" -I"..\..\..\..\Qt\2009.04\qt\mkspecs\win32-g++" -o release\main.o main.cpp

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    mingw32-make[1]: Leaving directory `C:/Users/Guido/Documents/Learning'
    mingw32-make: Leaving directory `C:/Users/Guido/Documents/Learning'
    mingw32-make[1]: *** [release/main.o] Error 3
    mingw32-make: *** [release] Error 2
    Exited with code 2.
    Error while building project Learning
    When executing build step 'Make'
    After which it displays the error message in my earlier post.

  6. #6
    Join Date
    Dec 2009
    Posts
    19
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    Try using Qt 4.6 (it seems that you are using qt 4.5), maybe mingw bundled with previous versions was incompatible with Windows Vista.
    Also try compiling your project from command line. Launch Qt Command Prompt (should be somewhere in your Start menu), enter your project's directory (cd "C:/Users/Guido/Documents/Learning/"), run "qmake -spec win32-g++ -r CONFIG+=release" and "mingw32-make -f Makefile.Release". If that doesn't make any difference, try to run just "qmake" without any parameters, and then run make command (the same as before).

  7. The following user says thank you to nateriver for this useful post:

    waitingforzion (26th December 2009)

  8. #7
    Join Date
    Dec 2009
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    Quote Originally Posted by nateriver View Post
    Try using Qt 4.6 (it seems that you are using qt 4.5), maybe mingw bundled with previous versions was incompatible with Windows Vista.
    Also try compiling your project from command line. Launch Qt Command Prompt (should be somewhere in your Start menu), enter your project's directory (cd "C:/Users/Guido/Documents/Learning/"), run "qmake -spec win32-g++ -r CONFIG+=release" and "mingw32-make -f Makefile.Release". If that doesn't make any difference, try to run just "qmake" without any parameters, and then run make command (the same as before).
    It works. Thank you.

    But now how do I build the same project for the linux platform, without running qmake on linux?

  9. #8
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    Quote Originally Posted by waitingforzion View Post
    But now how do I build the same project for the linux platform, without running qmake on linux?
    Why not use qmake? You'd have to write all build rules (including rcc, uic and moc) in a different build system (cmake, automake or (hard core) a Makefile) yourself.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  10. #9
    Join Date
    Dec 2009
    Posts
    19
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Release Mode Compiler Terminated with a Terrible Exception

    Quote Originally Posted by waitingforzion View Post
    But now how do I build the same project for the linux platform, without running qmake on linux?
    If you want to build your project for linux on windows, I doubt that it's possible, but who knows (need to check gcc's command line arguments)?
    But if you want to distribute sources of your application for building on linux, you can just run qmake on your development machine and distribute your project with makefiles that qmake generated. However, qmake makes some assumptions when generating makefiles, for example it's configured to use gcc as compiler by default, so if somebody tries to compile your project using generated makefiles, he might have to manually edit it if gcc is not installed. In this case the best way is to use 'configure' scripts, but I've never used them, so can't really help, sorry.
    "Do be do be do", Frank Sinatra

Similar Threads

  1. Replies: 1
    Last Post: 18th November 2009, 21:51
  2. Replies: 9
    Last Post: 15th April 2009, 06:23
  3. Not able to execute in Release Mode
    By sudheer168 in forum Qt Programming
    Replies: 4
    Last Post: 18th March 2009, 11:58
  4. Replies: 3
    Last Post: 27th January 2009, 09:31
  5. qodbc driver not loaded error in release mode
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2006, 09:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.