Exceptions crash (Qt SDK 1.2.1 - Qt4.8.1, MinGW, windows)

I have an ugly problem and would appreciate any help !! My program crashes out of the window at any time when an exception occurs, for example:

try { throw QString("lala"); } catch(QString &s) { ... } 

Im using Qt 4.8.1 with MinGW in QtCreator. I found a lot of discussion and tried

  • source recovery with -exceptions
  • adding QMAKE_CXXFLAGS + = -fexceptions

but no change. Windows tells me that the program crashed at the point where I selected the error. On Linux, everything works fine.

Not wanting to discuss the pros and cons of using exceptions in general, I wonder if there is a problem with Qt or MinGW and what I can do to get rid of the problem.

+4
source share
1 answer

You didn’t indicate what “failure” means, but if you get a message like “The application requested to exit the environment in an unusual way”, it means that your exception was completely selected from the program without getting anywhere. As I consider Since a specific message is created in the MSVC runtime, the mingw runtime may have another message with the same value or no message at all.

0
source

Source: https://habr.com/ru/post/1444096/


All Articles