c++ - Where is boost::filesystem::last_write_time? -
this linker error i'm getting. rest of boost::filesystem things resolving. i'm not understanding why 1 not. thought problem boost 1.40, upgraded 1.44 , problem remains. i'm using #define boost_filesystem_version 3 see no mention of last_write_time not being provided in case. seems underlying implementation missing, though api portion present.
1>testpruner.obj : error lnk2019: unresolved external symbol "void __cdecl boost::filesystem3::detail::last_write_time(class boost::filesystem3::path const &,long,class boost::system::error_code *)" (?last_write_time@detail@filesystem3@boost@@yaxabvpath@23@jpaverror_code@system@3@@z) referenced in function "void __cdecl boost::filesystem3::last_write_time(class boost::filesystem3::path const &,long)" (?last_write_time@filesystem3@boost@@yaxabvpath@12@j@z) oh yea, using windows vs2008.
the code involved is:
time_t curtime = time(null); bfs::last_write_time(bfs::path("testdata/prunetest/completed/batch001.dat"), curtime); anyone else run this?
and happens #define boost_filesystem_version 2 well. boost libraries i'm using boostpro (prebuilt, yea, i'm lazy)
2>testpruner.obj : error lnk2019: unresolved external symbol "class boost::system::error_code __cdecl boost::filesystem2::detail::last_write_time_api(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,long)" (?last_write_time_api@detail@filesystem2@boost@@ya?averror_code@system@3@abv?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@j@z) referenced in function "void __cdecl boost::filesystem2::last_write_time<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >(class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> const &,long)" (??$last_write_time@v?$basic_path@v?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@upath_traits@filesystem2@boost@@@filesystem2@boost@@@filesystem2@boost@@yaxabv?$basic_path@v?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@upath_traits@filesystem2@boost@@@01@j@z) from /versbose:lib
searching e:\program files\boost\boost_1_44\lib\libboost_thread-vc90-mt-gd-1_44.lib: searching e:\program files\boost\boost_1_44\lib\libboost_date_time-vc90-mt-gd-1_44.lib:
ok, problem simple obtuse. in vs2008 , above time_t 64 bits, unless #define _use_32_bit_time_t. boost libraries compiled without definition , therefore time_t 64 bits them. project due legacy issues define _use_32_bit_time_t , therefore generates api 32 bit time.
if build project doesn't use 32 bit time, works expected.
i'm glad c++ guys smart enough push call signature linker name mangling. if hadn't done that, i'd still wondering going on.
Comments
Post a Comment