libtorrent unresolved external

 ̄綄美尐妖づ 提交于 2019-12-24 19:24:56

问题


I'm getting the following error when I compile my program which links to libtorrent.lib. I've tried compiling libtorrent with different settings, I've tried enabling/disabling DHT, deprecated functions, etc.

error LNK2019: unresolved external symbol "void __cdecl libtorrent::rel_performancetimer_pools_nolog_resolvecountries_deprecated_dht_ext_(void)"

Is anyone here familiar with libtorrent, or can anyone provide any advice for getting rid of this error? I don't see any other libraries that I need to link to.

Thanks in advance.


回答1:


I've spent two days on it and finally I've found an issue. Name of this function "void rel_performancetimer_pools_nolog_resolvecountries_deprecated_dht_ext_" consists of the parts, that describes your current preferences. For example, dht_ means you're using DHT, and nolog_ means you're switched off TORRENT_LOGGING directive. The problem is: this settings works only with Release configuration! rel_ means release_. On the libtorrent 0.16.11 this problem still not solved. I've put this text in file build_config.hpp on the line 40:

#ifdef _DEBUG
#define TORRENT_DEBUG
#endif

This is the way to compile my project with libtorrent in release and debug configurations, without making any corrections. Arvid, please, include this 3 lines to your next version of libtorrent. Appreciated, Ilya from Russia.




回答2:


The problem was that my definitions in my project were inconsistent with the configuration/definitions in the libtorrent compilation, so some macros were calling a function that doesn't exist.



来源:https://stackoverflow.com/questions/11960365/libtorrent-unresolved-external

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!