[Boost-bugs] [Boost C++ Libraries] #11339: VC12 LNK2005 error with boost::container::adaptive_pool

Subject: [Boost-bugs] [Boost C++ Libraries] #11339: VC12 LNK2005 error with boost::container::adaptive_pool
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-24 23:32:42


#11339: VC12 LNK2005 error with boost::container::adaptive_pool
------------------------------+------------------------
 Reporter: anonymous | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
------------------------------+------------------------
 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)

 (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.

 FORCEINLINE HRESULT HRESULT_FROM_WIN32(unsigned long x) { return
 (HRESULT)(x) <= 0 ? (HRESULT)(x) : (HRESULT) (((x) & 0x0000FFFF) |
 (FACILITY_WIN32 << 16) | 0x80000000);}

 in winerror.h

 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11339>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC