Boost logo

Boost Users :

Subject: Re: [Boost-users] BOOST_ALL_NO_LIB / BOOST_THREAD_NO_LIB / BOOST_THREAD_DYN_LINK etc etc etc
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-05-28 04:52:50


Le 28/05/12 02:55, Josh Quigley a écrit :
> Hi,
>
>
> I'm trying to link to Boost.Thread DLL's. If I define BOOST_ALL_NO_LIB
> everything works fine - but it wants to link all packages as DLL,
> instead of just Boost.Thread.
Hi,

have you tried to define BOOS_ALL_DYN_LINK? See
http://www.boost.org/doc/libs/1_48_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code
> None of the following cause dynamic linking - that is I get a linker
> error saying the static *.lib could not be found. (defined on the
> command line, Visual Studio 2010)
> BOOST_THREAD_NO_LIB
This should not be defined because otherwise it inhibits the others.
> BOOST_THREAD_DYN_LINK
This should make linking wit the dll
> BOOST_THREAD_ALL_DYN_LINK
This is unknown.
> BOOST_THREAD_BUILD_DLL
> BOOST_THREAD_USE_DLL
These are legacy macros that equivalent to BOOT_THREAD_DYN_LINK.
> Is there a problem with
> - what I'm doing;
> - Visual Studio 2010; or
> - boost.thread?
>
>
>

Form the 1.50 documentation

"Boost.Thread is configured following the conventions used to build
libraries with separate source code. Boost.Thread will import/export the
code only if the user has specifically asked for it, by defining either
BOOST_ALL_DYN_LINK if they want all boost libraries to be dynamically
linked, or BOOST_THREAD_DYN_LINK if they want just this one to be
dynamically liked.

The definition of these macros determines whether BOOST_THREAD_USE_DLL
is defined. If BOOST_THREAD_USE_DLL is not defined, the library will
define BOOST_THREAD_USE_DLL or BOOST_THREAD_USE_LIB depending on the
platform. On non windows platforms BOOST_THREAD_USE_LIB is defined if is
not defined. In windows platforms, BOOST_THREAD_USE_LIB is defined if
BOOST_THREAD_USE_DLL and the compiler supports auto-tss cleanup with
Boost.Threads (for the time been Msvc and Intel)"

Please, could you create a ticket so that an error is issued when
incompatible macros as BOOST_THREAD_NO_LIB and BOOST_THREAD_BUILD_DLL
are used?

HTH,
Vicente



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net