次のコードを見てください。
#include <exception>
int main()
{
throw std::exception();
return 0;
}
Ubuntu Linuxでgccを使用してこれをコンパイルして実行すると、次の役立つ出力が得られます。
terminate called after throwing an instance of 'std::exception'
what(): std::exception
Aborted (core dumped)
ただし、コンパイルしてOS X Mountain Lion(GCCとclangの両方を使用)で実行すると、次のような、あまり役に立たない出力が得られます。
libc++abi.dylib: terminate called throwing an exception
未処理の例外でwhat()の出力を出力するようにOS Xをデフォルトにする方法はありますか?