Boost logo

Boost Users :

Subject: Re: [Boost-users] [Thread] Using thread accross libraries
From: Sébastien Gallou (sebastien.gallou_at_[hidden])
Date: 2013-12-02 18:05:22

> You are linking to the static Boost.Thread library. This means that
> you've got two distinct Boost.Thread libraries loaded into your process,
> one into the executable and one in the DLL.

Thanks Lars, you solve my problem.
Effectively, I was linking with the static lib.

When I was looking how to build shared libs, I found in the boost
documentation that shared build should be the default.
I'm under Windows, and without add link=shared to the b2 command line, the
build is static.

Next was the problem to link my app with boost. It was necessary to
define BOOST_ALL_DYN_LINK in boost\config\user.hpp, while the comment just
above says that it should not be needed for boost_thread : "Forces all
libraries [...] to be linked as dll's rather than static libraries on
Microsoft Windows. [...] Note that there may be some libraries that can
only [...] be dynamically linked (Boost.Threads for example), in these
cases this macro has no effect."

Is something I didn't well understand ?

Anyway, it now works,

Thank you again Lars,

Sebastien Gallou

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at