Boost logo

Boost :

Subject: Re: [boost] [thread]link problem with ibboost_thread-vc71-mt-gd-1_38.lib
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2009-02-16 08:21:18


WANG Xuewen <x2w2wang2_at_[hidden]> writes:

> I had a dll using MFC as shared library which works fine with boost
> 1.35. Recently, I've started to look at 1.38 and got the following
> link problem:
>
> libboost_thread-vc71-mt-gd-1_38.lib(tss_pe.obj) : error LNK2005:
> __pRawDllMain already defined in mfcs71d.lib(dllmodul.obj)
> libboost_thread-vc71-mt-gd-1_38.lib(tss_pe.obj) : warning LNK4006:
> __pRawDllMain already defined in mfcs71d.lib(dllmodul.obj); second
> definition ignored
>
> I've searched on internet and mailing list archive and didn't find a
> solution to the problem. Does anyone have an idea?

If you statically link to boost.thread from a DLL, it uses the
_pRawDllMain hook to ensure that thread-local storage is correctly
cleaned up when a thread exits. Unfortunately, MFC also tries to use the
same hook, so the two are not directly compatible. I recommend you use
the DLL version of Boost.thread

Anthony

-- 
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library   | http://www.stdthread.co.uk
Just Software Solutions Ltd         | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

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