Sounds like a known bug in libstdc ++ .
The problem is that when changing C ++ 11 ABI, many classes were duplicated in libstdc++6.so , one version with the old ABI, the other with the new one.
Exception classes were not duplicated, so this problem did not exist at that time. But then, with some new processing of the language, it was decided that std::ios_base::failure should be deduced from std::system_error instead of std::exception ... but system_error is only a C ++ 11 class, so it should use new ABI or he will complain. Now you have two different classes of std::ios_base::failure and the mess is in your hands!
A simple solution is to compile your program with -D_GLIBCXX_USE_CXX11_ABI=0 and resign to the old ABI until the error is resolved. Or alternatively write catch (std::exception &e) .
source share