Re: Exception handling and Windows


Thanks for your help. I was using MinGW, version 4.5.2 (the one provided on ). I changed for the version you suggested (, which labeled 4.4.5. With this version of the compiler, the behavior of the testcase program is different, but is still wrong ! When clicking on the button, I get :

- with mingw 4.5.2:
>terminate called after throwing an instance of 'std::exception'
>  what():  std::exception
and then the program terminates

- with mingw 4.4.5:
>Call to my_exception_handler
>terminate called without an active exception
and then the program terminates

The latest case behave as if the exception were first caught before calling to 'my_exception_handler': if I comment the try-catch block in this function, I get :
>Call to my_exception_handler
and then the program continues.

Any idea?


Le 04/08/2011 13:17, Armin Burgmeier a écrit :
Hi Yoann,

are you using MinGW or MSVC? If the former, then you should make sure to
use the same compiler as the one the official binaries were built with,


On Thu, 2011-08-04 at 11:50 +0200, Yoann Le Montagner wrote:

I have a problem with exception handling on Windows. In my application,
I set up a global exception handler with the function
Glib::add_exception_handler, so that this handler is supposed to be
called when an exception is thrown during the execution of the main
loop. It works fine when the program is built under Linux, but the
exception handler set up by Glib::add_exception_handler is never called
when the program is built under Windows.

I enclose a simple testcase. When clicking on the button:
- under Linux, the exception is normally catched in my_exception_handler,
- under Windows, the program terminates.

What's wrong? Thanks for your help.


gtkmm-list mailing list
gtkmm-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]