user1697973
user1697973

Reputation:

libtorrent-rasterbar and Visual Studio 2013

I'm trying to build a simple code (examples/simple_client.cpp) using libtorrent-rasterbar with VS2013 (C++), but I get the following linker error:

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)

I compile libtorrent using: bjam toolset=msvc-12.0 link=static variant=debug boost=source and link everything in VS:

Additional info: libtorrent-rasterbar-0.16.15; boost_1_55_0; Windows 8.1 64bits.

Any ideas on what's going wrong here?

Thank you.

Upvotes: 4

Views: 1920

Answers (1)

user1697973
user1697973

Reputation:

After some research and tests, I managed to build the project. That's what I did:

  1. Compiled using bjam toolset=msvc-12.0 geoip=off resolve-countries=off link=static variant=debug boost=source that way geoip and resolve-countries is disabled.

  2. Using @Hernán's tip of checking the libtorrent RSP files, I got the following preprocessor definitions:

    • BOOST_ASIO_SEPARATE_COMPILATION
    • BOOST_ALL_NO_LIB
    • BOOST_ASIO_ENABLE_CANCELIO
    • BOOST_ASIO_HASH_MAP_BUCKETS=1021
    • BOOST_EXCEPTION_DISABLE
    • BOOST_SYSTEM_STATIC_LINK=1
    • TORRENT_DISABLE_GEO_IP
    • TORRENT_DISABLE_RESOLVE_COUNTRIES
    • TORRENT_USE_I2P=1
    • TORRENT_USE_TOMMATH
    • UNICODE
    • WIN32_LEAN_AND_MEAN
    • _CRT_SECURE_NO_DEPRECATE
    • _FILE_OFFSET_BITS=64
    • _SCL_SECURE_NO_DEPRECATE
    • _UNICODE
    • _WIN32
    • _WIN32_WINNT=0x0500
    • __USE_W32_SOCKETS
  3. I added these definitions in VS. For debug configuration, one more definition was necessary: TORRENT_DEBUG (important).

Some websites I used:

Thank you for the help.

Upvotes: 7

Related Questions