這是我收到的鏈接器錯誤。我的所有其他boost :: filesystem事情正在解決。我不明白爲什麼這個沒有。我認爲這是一個提升1.40的問題,所以我升級到1.44,問題依然存在。我正在使用#define BOOST_FILESYSTEM_VERSION 3
,但我看不到在這種情況下沒有提供last_write_time。儘管api部分存在,但似乎缺少底層實現。boost :: filesystem :: last_write_time在哪裏?
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 *)" ([email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@Z) referenced in function "void __cdecl boost::filesystem3::last_write_time(class boost::filesystem3::path const &,long)" ([email protected]@[email protected]@[email protected]@[email protected])
哦,是的,使用Windows VS2008。
涉及的代碼是:
time_t curTime = time(NULL);
bfs::last_write_time(bfs::path("TestData/PruneTest/completed/Batch001.DAT"), curTime);
其他人遇到此?
它也發生在#define BOOST_FILESYSTEM_VERSION 2
。我使用的Boost庫是從boostpro(預建的,是的,我懶)
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)" ([email protected]@[email protected]@@[email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 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)" ([email protected][email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@@@[email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@Z)
從/ 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:
你鏈接到1.44版本還是1.40版本? – 2010-12-03 07:01:50
與1.44鏈接,它似乎在兩個中斷,雖然我只升級到1.44後鏈接失敗1.40,但我確實修復了庫路徑。 – boatcoder 2010-12-03 07:23:26