Boost logo

Boost Users :

Subject: Re: [Boost-users] Threads and linking against the right Boost-libs
From: Christoph (christoph.duelli_at_[hidden])
Date: 2008-12-07 03:13:52


Steven Watanabe wrote:

> AMDG
>
> Christoph Duelli wrote:
>> * When I have a program that use a second thread and only that second
>> thread does use Boost, will I need to link against the "-mt" libs?
>> (I am using linux.)
>> [An example would be: when I use some Boost facilities together with Qt:
>> [Qt4
>> creates threads even if I do not use any explicitly.]
>>
>
> It might work to use a single threaded library on linux, but I don't
> think it's guaranteed.
>
>> * If I create a lib and that lib does not use threads, but does use
>> Boost.Regex, I usually add a "-lboost_regex" to that lib.
>> If a program later on uses both my lib and threads, would I have had to
>> link against boost_regex-mt?
>>
>
> This is not essentially different from the above.
>
>> Does this boil down to 'if I might use threads I should always link
>> against the -mt libs'?
>>
>
> That would be the safest.
Thank you. I will link to the -mt libs then.


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