我正在尝试使用 Rasterbar 的 libtorrent 构建一个小型命令行 BitTorrent 客户端,该客户端依赖于 Boost。我已经使用各自的方向构建了 Boost 库和 libtorrent 库,但是当我尝试构建我的项目时,出现以下链接错误
1>------ Build started: Project: MiniBT, Configuration: Debug Win32 ------
1>MiniBT.obj : error LNK2019: unresolved external symbol "protected: static void __cdecl boost::asio::detail::winsock_init_base::throw_on_error(struct boost::asio::detail::winsock_init_base::data &)" (?throw_on_error@winsock_init_base@detail@asio@boost@@KAXAAUdata@1234@@Z) referenced in function "public: __thiscall boost::asio::detail::winsock_init<2,0>::winsock_init<2,0>(bool)" (??0?$winsock_init@$01$0A@@detail@asio@boost@@QAE@_N@Z)
1>MiniBT.obj : error LNK2019: unresolved external symbol "protected: static void __cdecl boost::asio::detail::winsock_init_base::startup(struct boost::asio::detail::winsock_init_base::data &,unsigned char,unsigned char)" (?startup@winsock_init_base@detail@asio@boost@@KAXAAUdata@1234@EE@Z) referenced in function "public: __thiscall boost::asio::detail::winsock_init<2,0>::winsock_init<2,0>(bool)" (??0?$winsock_init@$01$0A@@detail@asio@boost@@QAE@_N@Z)
1>MiniBT.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::asio::error::get_misc_category(void)" (?get_misc_category@error@asio@boost@@YAABVerror_category@system@3@XZ) referenced in function "void __cdecl boost::asio::error::`dynamic initializer for 'misc_category''(void)" (??__Emisc_category@error@asio@boost@@YAXXZ)
1>MiniBT.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl boost::asio::detail::win_tss_ptr_create(void)" (?win_tss_ptr_create@detail@asio@boost@@YAKXZ) referenced in function "public: __thiscall boost::asio::detail::win_tss_ptr<class boost::asio::detail::call_stack<class boost::asio::detail::win_iocp_io_service,unsigned char>::context>::win_tss_ptr<class boost::asio::detail::call_stack<class boost::asio::detail::win_iocp_io_service,unsigned char>::context>(void)" (??0?$win_tss_ptr@Vcontext@?$call_stack@Vwin_iocp_io_service@detail@asio@boost@@E@detail@asio@boost@@@detail@asio@boost@@QAE@XZ)
1>MiniBT.obj : error LNK2019: unresolved external symbol "protected: static void __cdecl boost::asio::detail::winsock_init_base::cleanup(struct boost::asio::detail::winsock_init_base::data &)" (?cleanup@winsock_init_base@detail@asio@boost@@KAXAAUdata@1234@@Z) referenced in function "public: __thiscall boost::asio::detail::winsock_init<2,0>::~winsock_init<2,0>(void)" (??1?$winsock_init@$01$0A@@detail@asio@boost@@QAE@XZ)
似乎表明 asio::detail 命名空间没有包含在 boost-system 库中,因为它似乎只有这 5 个符号有问题,并且它链接到 boost-system 库就好了,否则. 我正在尝试在 64 位系统上构建 32 位应用程序,但我检查过的所有内容似乎都为此正确配置了。
我知道我错过了一些东西,但我似乎无法弄清楚是什么。有没有人有什么建议?