PDA

View Full Version : gcc exceptions



ctarsoaga
12th April 2010, 21:08
Hi everybody,

I try to get a simple try catch using (qt with) mingw including gcc 4.4.0 and it does not work


try {
throw std::logic_exception("error");
} catch (const std::logic_exception& ex) {
std::cout << ex.what();
}
catch (...) {
std::cout << "bad";
}

NO EXCEPTION IS CAUGHT!!! NEVER! Not even in the catch-all...

program terminates ("terminate called after throwing instance of....")

How do I catch these in gcc 4.4.0?? Is there a compiler flag or what???

Thanks a million

Chris

qt_gotcha
4th May 2010, 07:37
have you found a solution? I have the same problem...
thanks