Subject: Re: [boost] [threads] Unexpected behaviour of Thread loal storage
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2015-05-06 04:32:07
On Wed, May 6, 2015 at 11:25 AM, Fu ji <fujimailing_at_[hidden]> wrote:
>> Do you link to Boost.Thread built as a shared library (dll)? Both
>> libraries must use Boost.Thread dll because it maintains a global list
>> of thread_specific_ptr storage objects internally.
> This could be a problem, in both solutions I have in Properties:
> Additional Include Directories: ..\3rdParty\Common\include\boost
> (here I have .hpp files)
> and in Linker:
> Additional Library Directories: ..\3rdParty\$(Platform)\VC12\lib
> and here I have libboost_thread-vc120-mt-1_57.lib
I don't use Windows but AFAIR the library name should be something
like boost_thread-vc120-mt-1_57.lib (note no leading 'lib') and a
similarly named dll. If you don't have these you will have to rebuild
boost. Make sure you add 'link=shared' to b2 command line.
> May I do this in some other way ? I read that I can achieve that by define:
> #define BOOST_ALL_DYN_LINK
> in pre-compiled header stdafx.h
Yes, BOOST_ALL_DYN_LINK must be defined when you build both your libraries.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk