如果我用gcc-7、-static-libstdc++和-static-libgcc编译这个简单程序,然后在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;
}它失败,错误代码为134。
为什么它不像在linux上用相同的选项编译时那样打印"abc123“呢?
https://stackoverflow.com/questions/50920999
复制相似问题