[英]Why don't exceptions work with gcc7 and -static-libgcc on OSX?
If I compile this simple program with gcc-7, -static-libstdc++
, and -static-libgcc
; 如果我使用gcc-7,
-static-libstdc++
和-static-libgcc
编译这个简单的程序; then run on OSX 然后在OSX上运行
#include <exception>
#include <iostream>
int main() try {
throw std::runtime_error{"abc123"};
return 0;
} catch (const std::runtime_error& e) {
std::cout << e.what() << "\n";
return 0;
}
it fails with error code 134. 它失败,错误代码为134。
Why doesn't it print "abc123" as it does when compiled with the same options on linux? 为什么它不打印“abc123”,就像在linux上使用相同的选项编译时一样?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.