I downloaded and built boost libraries (version 1.47.0) on Windows 7 (64 bit), following the instructions here .
Now that I want to use the Boost::Filesystem library, I can include the header file without any problems, and it compiles my code file. A problem occurs when linking. I get the following errors:
main.obj : error LNK2019: unresolved external symbol "class boost::filesystem3::file_status __cdecl boost::filesystem3::detail::status(class boost::filesystem3::path const &,class boost::system::error_code *)" ( ?status@detail @ filesystem3@boost @@ YA?AVfile_status@23 @ AEBVpath@23 @ PEAVerror_code@system @ 3@ @Z) referenced in function "bool __cdecl boost::filesystem3::exists(class boost::filesystem3::path const &)" ( ?exists@filesystem3 @ boost@ @ YA_NAEBVpath@12 @@Z) main.obj : error LNK2019: unresolved external symbol "private: static class std::codecvt<wchar_t,char,int> const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(void)" ( ?wchar_t_codecvt_facet@path @ filesystem3@boost @@ CAAEAPEBV?$codecvt@ _WDH@std @@XZ) referenced in function "public: static class std::codecvt<wchar_t,char,int> const & __cdecl boost::filesystem3::path::codecvt(void)" ( ?codecvt@path @ filesystem3@boost @@ SAAEBV?$codecvt@ _WDH@std @@XZ)
(among others)
Perhaps it is worth noting that when I first tried to build the project, he said that he could not find the .lib file libboost_filesystem-vc100-mt-1_47.lib . I specifically did not say that this file is needed, so I'm not sure how he understood it? In any case, I pointed the linker to the correct directory, and then it gave the above errors.
Does anyone know how to solve this problem? Thanks.
Edit: I am using toolchain VS2010 through eclipse CDT to create a system. Full compilation command
cl /c /EHs /MD /Zi /I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" /I"C:\boost_1_47_0" /nologo <SOURCE_FILE>
and linker team
link /debug /nologo /libpath:C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64 /libpath:C:\boost_1_47_0\stage\lib /libpath:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64 /OUT:<EXE_NAME> <OBJECT_FILES>
source share