My project contains a shared library and an exe client. I found that my own exception class thrown from the library was not caught by the catch catch block, and the program ended with the message "ending the call after sending the instance ...". Continuing to play with the project, I found that any exception of any type was not caught. For example, this catch does not work:
try
{
m_pSerialPort = new boost :: asio :: serial_port (m_IoService, "non-existing-port");
}
catch (const boost :: system :: system_error & e)
{
// ...
}
Error message:
terminate called after throwing an instance of
'boost :: exception_detail :: clone_impl
<boost :: exception_detail :: error_info_injector
<boost :: system :: system_error>> '
what (): No such file or directory
The GCC version is 4.4.1, the Linux OS. The same code works successfully on Windows MSVC. What reason could prevent GCC from correctly recognizing exceptions?
c ++ gcc exception-handling
Alex f
source share