My project contains shared library and exe client. I found that my own exception class thrown from the library is not caught by client catch block, and program terminates with "terminate called after throwing an instance of ..." message. Continuing to play with the project, I found that any exception of any type is not caught. For example, this catch doesn't 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
GCC version is 4.4.1, Linux OS. The same code is running successfully in Windows, MSVC. What reason can prevent GCC program to catch exceptions properly?