Dear All,
I'm using C::B and installed it with the installer incl MinGW. In my code (which is a wxWidgets GUI app without DLL's) I use the exception handling with try and catch.
try
{
}
catch(const std::exception& ex)
{
std::cout << "Exception caught: " << ex.what() << std::endl;
}
When I compile the program with MinGW and run it the program crashes without throwing any exception.
However when I compile the same program by changing the GCC compiler to MSVC compiler in C::B the program works fine and throws the exception. It also works under C::B and GCC in Linux.
My question is: Is this a bug in C::B or MinGW or are there settings not correct and how to solve this? I have played with the -fexceptions without success.
I saw some problems with MinGW but I understood that it was only causing problems when using DLL's and I don't use them.
Thanks for your reaction.
I did the following test. In C::B I made a new console appication with the GCC compiler as compiler settings and with the following test code:
#include <iostream>
using namespace std;
int main()
{
try
{
throw "Memory allocation failure!";
}
catch(char* strg)
{
cout<<"Testing Exceptions: "<<strg<<endl;
}
cout << endl << endl << endl <<"ENDING PROGRAM"<<endl;
}
Then the console window shows see image mingw.jpg in the attachment.
When I then only change the compiler to MSVC compiler and nothing else I get see image MSVC.jpg in the attachment.
So with the most minimum application it is still not working.
[attachment deleted by admin]