Boost logo

Boost Users :

Subject: Re: [Boost-users] some warning C4273: inconsistent dll linkage
From: code (b4code_at_[hidden])
Date: 2011-11-18 11:07:03


Hi Alex,

Thank you so much for the great advice.

When I set #define BOOST_THREAD_DYN_LINK in my code, do I need to set
#define BOOST_THREAD_NO_LIB at the same time?

Thank you so much again!

Yan

--- On Fri, 11/18/11, Alex Perry <Alex.Perry_at_[hidden]> wrote:

From: Alex Perry <Alex.Perry_at_[hidden]>
Subject: [Boost-users] some warning C4273: inconsistent dll linkage
To: "boost-users_at_[hidden]" <boost-users_at_[hidden]>
Cc: "b4code_at_[hidden]" <b4code_at_[hidden]>
Date: Friday, November 18, 2011, 1:11 AM

On Thu, 17 Nov 2011 12:07:57 -0800 (PST) code <b4code_at_[hidden]> wrote:-
> Hi Boost Users,
>
> When I compiled and linked my projects with Boost libraries, I got the
> following warnings
>

...snip...

> I want to link Boost.thread dll dynamically and other Boost libraries statically.
>
> If I set #define BOOST_ALL_DYN_LINK, I could not generate

...snip...

I didn't see any answer to this but apologies if its already been answered.

#define BOOST_ALL_DYN_LINK

Is for use within your own consuming code - use the bjam --link option to control which version of boost libraries are built eg in boost root do:-

bjam variant=debug,release threading=multi link=shared stage --with-thread

which would build boost-thread as dll (bjam --help to get more info on options) then:

#define BOOST_THREAD_DYN_LINK

In your code would use the dll version of boost.thread (any other boost libs would still be looking for static versions)

HTH

Alex



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