I am trying to compile my program but it wouldn't link at all. I have specified the path to the boost lib files and the linker still complain. Here's the linking error I got:
1>Edproj.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ)
1>Edproj.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ)
1>Edproj.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_base@detail@boost@@UAE@XZ)
1>Edproj.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z)
1>Edproj.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::detach(void)" (?detach@thread@boost@@QAEXXZ)
1>Edproj.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::join(void)" (?join@thread@boost@@QAEXXZ)
1>Edproj.obj : error LNK2001: unresolved external symbol "private: void __thiscall boost::thread::start_thread(void)" (?start_thread@thread@boost@@AAEXXZ)
1>Edproj.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::this_thread::interruptible_wait(void *,struct boost::detail::timeout)" (?interruptible_wait@this_thread@boost@@YA_NPAXUtimeout@detail@2@@Z)
BOOST_LIB_DIAGNOSTIC returns
1> Linking to lib file: libboost_thread-vc100-mt-s-1_52.lib
1> Linking to lib file: libboost_date_time-vc100-mt-s-1_52.lib
1> Linking to lib file: libboost_system-vc100-mt-s-1_52.lib
1> Linking to lib file: libboost_chrono-vc100-mt-s-1_52.lib
More info:
I am running a 64-bit Windows 8 Pro and I compiled boost with the following option
bjam --build-type=complete --toolset=msvc10.0 address-model=64 architecture=x86 variant=debug,release threading=multi link=static runtime-link=static
Can someone tell me what is wrong?
Update:
After changing to boost 1.51 it got rid 7 out of 8 of those linker errors but this one is still persistent
error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z)
I don't get what is going on here. This one is from boostpro 32 bit installer. It couldn't have something to do with my source file right?
Update :
Ok I have solved this problem for boost 1.51. Turns out in the Property Pages >> C/C++ >> Code Generation >> Enable C++ Exceptions was turn off for me.
OK. I will attempt to see if the same settings solve the problem for boost 1.52. Will update later.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…