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

版权声明:本文为博主原创文章,自己总结难免有出错或是不周全的地方,望指出...... https://blog.csdn.net/qq849635649/article/details/46906763
我再学习《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"可以解决这个问题

猜你喜欢

转载自blog.csdn.net/qq849635649/article/details/46906763
今日推荐