学习boost过程中使用from_string函数报错

我再学习《boost程序完全开发指南》中按照书上给的例程写from_string给date类型赋值时报错,错误如下:

1>test_date_time.obj : error LNK2019: unresolved external symbol "public: static class boost::shared_ptr<class stlp_std::map<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> >,unsigned short,struct stlp_std::less<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > >,class stlp_std::allocator<struct stlp_std::pair<class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const ,unsigned short> > > > __cdecl boost::gregorian::greg_month::get_month_map_ptr(void)" (?get_month_map_ptr@greg_month@gregorian@boost@@SA?AV?$shared_ptr@V?$map@V?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@GU?$less@V?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@G@stlp_std@@@2@@stlp_std@@@3@XZ) referenced in function "unsigned short __cdecl boost::date_time::month_str_to_ushort<class boost::gregorian::greg_month>(class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const &)" (??$month_str_to_ushort@Vgreg_month@gregorian@boost@@@date_time@boost@@YAGABV?$basic_string@DV?$char_traits@D@stlp_std@@V?$allocator@D@2@@stlp_std@@@Z)


总之是一些看不懂的,这是因为没有包含一个人头文件所致:

#include "libs/date_time/src/gregorian/greg_month.cpp"可以解决这个问题

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值