[Boost-users] BOOST_ALL_NO_LIB / BOOST_THREAD_NO_LIB / BOOST_THREAD_DYN_LINK etc etc etc

735 views
Skip to first unread message

Josh Quigley

unread,
May 27, 2012, 8:55:53 PM5/27/12
to boost...@lists.boost.org
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.

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
BOOST_THREAD_DYN_LINK
BOOST_THREAD_ALL_DYN_LINK
BOOST_THREAD_BUILD_DLL
BOOST_THREAD_USE_DLL

Is there a problem with
- what I'm doing;
- Visual Studio 2010; or
- boost.thread?


Cheers,

Josh.
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Vicente J. Botet Escriba

unread,
May 28, 2012, 4:52:50 AM5/28/12
to boost...@lists.boost.org
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.

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

Reply all
Reply to author
Forward
0 new messages