libtorrent unresolved external

2019-08-29 17:57发布

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.

2条回答
三岁会撩人
2楼-- · 2019-08-29 18:45

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.

查看更多
神经病院院长
3楼-- · 2019-08-29 18:53

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.

查看更多
登录 后发表回答