Runtime error with try catch o.o

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Runtime error with try catch o.o

Post by Tapsa » Fri Jun 26, 2015 3:07 pm

I recently upgraded my compiler to MinGW 4.9.1 from MinGW 4.6.2.
I am also trying wxWidgets 3.0.2 coming from 2.8.12.

This code runs fine when put into widgets sample, but when I use it in my very big and complex wxWidgets project, it results in C Runtime error and the program exits. That is, if the lexical cast fails and catch happens.

Code: Select all

    int32_t result = 9000;
    try
    {
        result = boost::lexical_cast<int32_t>("42u");
    }
    catch(boost::bad_lexical_cast e)
    {
        result = 24;
    }
How can this be so? Only a header file is even needed for those lexical cast functions.

Post Reply