From b03e99ab40e9f5189266e3fbe7312039ec193137 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 15 Apr 2012 04:00:58 +0000 Subject: [PATCH] fix DLL export issue on windows --- ChangeLog | 1 + Jamfile | 7 +++++++ include/libtorrent/config.hpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ef7e15b1b..f1cd33cc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ + * fixed DLL export issue on windows (when building a shared library linking statically against boost) * fixed FreeBSD build * fixed web seed performance issue whith pieces > 1 MiB * fixed unchoke logic when using web seeds diff --git a/Jamfile b/Jamfile index abdd682da..054cd730c 100755 --- a/Jamfile +++ b/Jamfile @@ -587,6 +587,13 @@ lib torrent BOOST_THREAD_USE_LIB multi shared:TORRENT_BUILDING_SHARED + + # on windows, when linking statically against asio + # but producing a DLL, everything inside the DLL needs + # to declare the symbol as being exported + shared,static:BOOST_ASIO_SOURCE + shared,static:BOOST_SYSTEM_SOURCE + on:src/kademlia/$(KADEMLIA_SOURCES).cpp logging:src/kademlia/$(KADEMLIA_SOURCES).cpp @building diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index c75e2ff3c..f9de4457e 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -69,7 +69,7 @@ POSSIBILITY OF SUCH DAMAGE. // backwards compatibility with older versions of boost #if !defined BOOST_SYMBOL_EXPORT && !defined BOOST_SYMBOL_IMPORT -# ifdef _MSC_VER +# if defined _MSC_VER || defined __MINGW32__ # define BOOST_SYMBOL_EXPORT __declspec(dllexport) # define BOOST_SYMBOL_IMPORT __declspec(dllimport) # elif __GNU__ >= 4