【发布时间】:2014-04-27 18:30:36
【问题描述】:
我正在尝试使用带有 VS2013 (C++) 的 libtorrent-rasterbar 构建一个简单的代码 (examples/simple_client.cpp),但出现以下链接器错误:
error LNK2019: unresolved external symbol "void __cdecl libtorrent::rel_performancetimer_pools_nolog_resolvecountries_deprecated_nodht_ext_(void)" (?rel_performancetimer_pools_nolog_resolvecountries_deprecated_nodht_ext_@libtorrent@@YAXXZ) referenced in function "public: __thiscall libtorrent::session::session(struct libtorrent::fingerprint const &,int,unsigned int)" (??0session@libtorrent@@QAE@ABUfingerprint@1@HI@Z)
我使用:bjam toolset=msvc-12.0 link=static variant=debug boost=source 编译 libtorrent 并链接 VS 中的所有内容:
- libboost_system-vc120-mt-gd-1_55.lib
- libboost_date_time-vc120-mt-gd-1_55.lib
- libtorrent.lib
附加信息: libtorrent-rasterbar-0.16.15;升压_1_55_0; Windows 8.1 64 位。
对这里出了什么问题有什么想法吗?
谢谢。
【问题讨论】:
-
几天前我在VS2012中看到过同样的问题。
-
您的项目中是否也包含了库路径?从错误中也可以看出该方法使用了一些已弃用的代码。也许您必须在库编译中定义一些定义才能使用它?
-
是的,我已经包含了库路径。根据 libtorrent 文档,构建标志 'deprecated-functions' 默认设置为 on。
-
您是否检查了输出 bjam 目录中的 RSP 响应文件以查看您需要哪些#define 符号?
-
我刚刚检查了它 (libtorrent.lib.rsp),但它只列出了 .obj 文件(抱歉,我对 bjam 构建不太熟悉)。
标签: c++ visual-c++ boost libtorrent libtorrent-rasterbar