简体   繁体   中英

Linking error in C++ Boost library

I am new to C++ Boost library.

I already installed Boost 1.51 at BoostPro Computing website, both 32-bit and 64-bit versions (at two different folders (boost_1_51 and boost_1_51_x64).

I tried to use Visual Studio 2005 SP2 (on 32-bit Windows OS) to build for x64 and got the following errors:

error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ)
error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ)

I did the library linking in project configuration (boost paths for additional include and library directories). For example:

include : C:\\Program Files\\boost\\boost_1_51_x64\\

library : C:\\Program Files\\boost\\boost_1_51_x64\\lib

Can anyone can help me figure out the linking error as above?

From the comments above:

I solved the problem by re-installing the boost library (64-bit version). Maybe there were some errors during my last installation.

I fixed this problem by manually adding "boost_system-vc120-mt-1_61.lib" (your version will be different) to the project. I was using the prebuilt windows binaries https://sourceforge.net/projects/boost/files/boost-binaries/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM