[thread]link problem with ibboost_thread-vc71-mt-gd-1_38.lib

Hello, 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? Thanks, Xuewen

WANG Xuewen <x2w2wang2@free.fr> 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
participants (2)
-
Anthony Williams
-
WANG Xuewen