snowyu / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
1 stars 0 forks source link

Must not define both BOOST_SYSTEM_DYN_LINK and BOOST_SYSTEM_STATIC_LINK #382

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
OS: Windows 8
Compiler: MSVC2012
Boost: 1.52
lt_rasterbar: 0.16.5

When using boost 1.52 and creating shared libs with

bjam.exe link=shared runtime-link=shared boost=source variant=release 
debug-symbols=off address-model=64

causes build error through following boost code parts:

Source: http://www.boost.org/doc/libs/1_50_0/boost/system/config.hpp

Code:
#if defined(BOOST_SYSTEM_DYN_LINK) && defined(BOOST_SYSTEM_STATIC_LINK) 
# error Must not define both BOOST_SYSTEM_DYN_LINK and BOOST_SYSTEM_STATIC_LINK
#endif

These lines were added with boost 1.50.0.

For successfully compiling I removed these lines but this should not be the way 
to go.

Original issue reported on code.google.com by manuel.g...@quantum-bytes.com on 7 Nov 2012 at 5:01

GoogleCodeExporter commented 9 years ago
The fundamental problem here is that boost.system no longer allows to link 
against it statically while at the same time ask it to export its symbols. The 
libtorrent Jamfile defaults to <link>static and <boost-link>static (the latter 
is a feature made up by that Jamfile). This means that with recent versions of 
boost, the <link> and <boost-link> features need to be set in lock-step. If 
you're linking libtorrent shared, you have to link against all the boost 
libraries as shared libraries as well, and vice versa.

Being able to build the python binding as one monolithic shared library 
(including all of boost) is quite convenient, especially on windows, so I'm 
hesitant to remove the <boost-link> feature.

What I think it boils down to is that boost-build really should have two 
separate features, one for the actual linking and one to indicate to the 
library whether or not it will be part of a shared library (even if itself 
isn't built as one).

Do you have any suggestions on how to improve this?

Original comment by arvid.no...@gmail.com on 16 Nov 2012 at 6:32

GoogleCodeExporter commented 9 years ago
http://comments.gmane.org/gmane.comp.lib.boost.build/25685 maybe this can help. 
(I don't familiar with bjam at all)

I fixed my problem with boost-link=shared.

Original comment by manuel.g...@quantum-bytes.com on 29 Oct 2013 at 9:49