在MFC中使用boost的多线程库,可能会抛出链接错误:
__pRawDllMain already defined in ....
这是由于thread的源码中叶有一个入口函数
extern BOOL (WINAPI * const _pRawDllMain)(HANDLE, DWORD, LPVOID)=&dll_callback;
解决方法是将
boost/libs/thread/src/win32/tss_pe.cpp
中的这句话注释然后重新编译即可解决。
网上看到另一种方法,经测试失败,如果测试成功请告之
链接:http://www.juicydata.com/LinkingMfcAndBoostThread
原文如下:
Linking against Boost can sometimes be tricky, as a minor misconfiguration in your project / makefiles can cause the auto-link mechanism to operate differently than you expect. Here's one example of a failure during link:
libboost_thread-vc80-mt-1_40.lib(tss_pe.obj) : error LNK2005: __pRawDllMain already defined in mfcs80.lib(rawdllmainproxy.obj) Creating library c:\Work\MyLib\Release\MyLib.lib and object c:\Wo