c++編譯的庫(kù)文件再運(yùn)行是報(bào)
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
原因:接口庫(kù)文件在接口調(diào)用時(shí)有返回GBK字段,但是由于本地機(jī)器沒(méi)有安裝相應(yīng)的語(yǔ)言包支持。所以程序出錯(cuò)崩潰。
解決方法:安裝中文語(yǔ)言包支持
$sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
en_US.UTF-8... done
zh_CN.GB2312... done
zh_CN.GB18030... done
zh_CN.GBK... done
zh_CN.UTF-8... done
Generation complete.