我正在使用boost/iostreams/filtering/gzip.hpp
库,由于某种原因,它适用于g ++(4.2 - 古老版本,预装在mac上),但使用clang ++编译完全相同的代码会导致故障:
std::ifstream file(fname.c_str(), std::ios_base::in | std::ios_base::binary);
boost::iostreams::filtering_istream in;
in.push(boost::iostreams::gzip_decompressor()); // This line causes the segfault
in.push(file);
我不知道导致问题的原因。有什么建议吗?