Boost logo

Boost Users :

Subject: [Boost-users] Linker error when using time_from_string
From: nick.snels_at_[hidden]
Date: 2016-06-02 08:17:10


The following code gives an error for the time_from_string function (from_time_t works just fine):

using namespace boost::posix_time;
ptime epoch = from_time_t(0);
ptime other = time_from_string("2011-08-09 17:27:00.000000");

The error is:

main.obj:-1: error: LNK2019: unresolved external symbol "public: static class boost::shared_ptr<class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned short,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,unsigned short> > > > __cdecl boost::gregorian::greg_month::get_month_map_ptr(void)" (?get_month_map_ptr_at_greg_month_at_gregorian@boost@@SA?AV?$shared_ptr_at_V?$map_at_V?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@GU?$less_at_V?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@2_at_V?$allocator_at_U?$pair@$$CBV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@G_at_std@@@2@@std@@@3_at_XZ) referenced in function "unsigned short __cdecl boost::date_time::month_str_to_ushort<class boost::gregorian::greg_month>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$month_str_to_ushort_at_Vgreg_month_at_gregorian@boost@@@date_time_at_boost@@YAGAEBV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@Z)

I’m using Qt Creator, along with Visual Studio 2015. I have the installed the windows binary of boost 1.61.1 .



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net