Boost logo

Boost :

Subject: [boost] Some library dependency and auto liker issues
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-08-20 12:20:50


Hi,

there is an issue https://svn.boost.org/trac/boost/ticket/7045 that I
don't know how to fix.

The problem is related to library dependencies and auto-linker.

* 1st issue: Boost.Threads depends on Boost.DateTime but only for the
header only part. Anyway, it includes a DateTime file that includes the
boost/config/auto_link.hpp, and this makes the tools using the auto
linker to create a dependency on Boost.DateTime. As the Boost.Threads
build Jamfile doesn't link with Boost.DateTime, the command

bjam toolset=msvc-11.0 --build-type=complete --with-thread

doesn't build the library Boost.DateTime and so when a tool such as Visual studio uses the auto linker information, it tries to link with Boost.DateTime and not finds it, as not build (even if it is not needed).

What is the best way to fix this?
Should Boost.Thread link with Boost.DateTime, even if it don't needs it?
Or just document that the user relaying on auto-linker needs to build explicitly the boost_date_time library with the command:

bjam toolset=msvc-11.0 --build-type=complete --with-thread --with-date_time

* 2nd issue: Boost.Threads depends on Boost.Chrono and the library is linked with boost_chrono. When a user includes for example <boost/thread/tss.hpp> the autolinker doesn't detects the chrono dependency as this file don't depends on any file in boost/chrono.
But as boost_thread depends on boost_chrono, the linker find some unresolved symbols.

What is the best way to fix this?
Should Boost.Thread include boost/chrono.hpp in all their public files even if not needed other than by auto linker tools?
Or just document that the user relaying on auto-linker needs to include only the top level file <boost/thread.hpp> so that all the dependencies are covered?

Any suggestions are welcome,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk