读书人

boost:locale:conv:between()调试不通

发布时间: 2013-09-17 13:35:59 作者: rapoo

boost::locale::conv::between()调试不通过



#include <string>
#include <boost/locale/conversion.hpp>
#include <boost/locale/encoding.hpp>

using namespace std;
using namespace boost;

string s = "d啊";
string ss = conv::between( s, "UTF-8", "GBK" );


F:\testCpp\testCpp\main.cpp:-1: 错误:undefined reference to `boost::locale::conv::between(char const*, char const*, std::string const&, std::string const&, boost::locale::conv::method_type)' boost
[解决办法]
不好意思,我看错了

string ss = boost::locale::conv::between( s, "UTF-8", "GBK" );

[解决办法]
你只using了boost,并没有using boost::locale
[解决办法]
查了下手册,好像的确是要先编译,很抱歉误导lz了

读书人网 >C++

热点推荐