链接C ++ Boost库中的错误

时间:2012-09-12 14:11:24

标签: c++ boost linker 32bit-64bit

我是C ++ Boost库的新手。

我已经在BoostPro Computing网站上安装了Boost 1.51,包括32位和64位版本(两个不同的文件夹(boost_1_51和boost_1_51_x64)。

我尝试使用Visual Studio 2005 SP2(在32位Windows操作系统上)为x64构建并出现以下错误:

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)

我在项目配置中进行了库链接(其他包含和库目录的增强路径)。例如:

  

包含:C:\ Program Files \ boost \ boost_1_51_x64 \

     

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

任何人都可以帮我解决上面的链接错误吗?

2 个答案:

答案 0 :(得分:2)

来自上述评论:

  

我通过重新安装boost库(64位版本)解决了这个问题。也许在我上次安装过程中出现了一些错误。

答案 1 :(得分:0)

我通过手动将“boost_system-vc120-mt-1_61.lib”(您的版本将不同)添加到项目中来解决此问题。我正在使用预先构建的Windows二进制文件https://sourceforge.net/projects/boost/files/boost-binaries/