Boost C++ Libraries: Ticket #11339: VC12 LNK2005 error with boost::container::adaptive_pool https://svn.boost.org/trac10/ticket/11339 <p> Unfortunately I cannot reproduce it in a test project. The problem appears when a delayed load DLL is linked to the main app. The error is Delayimp.lib(delayhlp.obj) : error LNK2005: HRESULT_FROM_WIN32 already defined in libboost_container-vc120-mt-1_58.lib(alloc_lib.obj) </p> <p> (Making the DLL non-delayed makes the error go away.) This seems to be related to unsetting the FORCEINLINE define in dlmalloc_ext_2_8_6.c (line 34). I am not sure it it was an intention but FORCEINLINE is also defined in windows headers and unsetting it un-inlines windows functions included in dlmalloc_2_8_6.c (line 544), e.g. </p> <p> FORCEINLINE HRESULT HRESULT_FROM_WIN32(unsigned long x) { return (HRESULT)(x) &lt;= 0 ? (HRESULT)(x) : (HRESULT) (((x) &amp; 0x0000FFFF) | (FACILITY_WIN32 &lt;&lt; 16) | 0x80000000);} </p> <p> in winerror.h </p> <p> Commenting out the line 34 in dlmalloc_ext_2_8_6.c fixes this but perhaps this define should have a different name, e.g. CONT_FORCEINLINE (?) Thanks. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11339 Trac 1.4.3 Ion Gaztañaga Sat, 13 Jun 2015 14:48:03 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11339#comment:1 https://svn.boost.org/trac10/ticket/11339#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks for the report. Tried a fix in: </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/commit/5d35aec80fd8c96181c7b0fb4c543fe18c6ee9a5"><span class="icon">​</span>https://github.com/boostorg/container/commit/5d35aec80fd8c96181c7b0fb4c543fe18c6ee9a5</a> </p> <p> [develop 5d35aec] Fixed Trac <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/11339" title="#11339: Bugs: VC12 LNK2005 error with boost::container::adaptive_pool (closed: fixed)">#11339</a> ("VC12 LNK2005 error with boost::container::adaptive_pool") </p> <blockquote> <p> 2 files changed, 5 insertions(+), 1 deletion(-) </p> </blockquote> <p> The macro could be deleted for all except GCC which does not like the default dlmalloc's definition </p> Ticket