Re: [Boost-bugs] [Boost C++ Libraries] #1871: regex link error with msvc

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1871: regex link error with msvc
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-05-09 17:07:12


#1871: regex link error with msvc
-----------------------------------------+----------------------------------
  Reporter: cedric.naniot@… | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: Boost 1.36.0 | Component: regex
   Version: Boost 1.46.1 | Severity: Problem
Resolution: wontfix | Keywords:
-----------------------------------------+----------------------------------
Changes (by johnmaddock):

  * status: reopened => closed
  * resolution: => wontfix

Comment:

 OK, can reproduce, but I don't have a fix that doesn't break something
 else.

 This is caused by wc_regex_traits.cpp and usinstances.cpp which pull in
 __declspec(dllexport) std::allocator<unsigned short>::allocator(), but
 then your source files result in std::allocator<unsigned
 short>::allocator() (without the dllimport) being defined and hence the
 clash. In other words it's caused by MS's headers getting in a pickle and
 defining symbols differently depending what compiler options are used.

 There are two solutions:

 Manually add the regex source files to your project with the exception of
 cw_regex_traits.cpp and usinstances.cpp, or build everything with
 BOOST_REGEX_DYN_LINK defined and link to the regex dll rather than the
 static lib.

 HTH, John.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/1871#comment:9>
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:06 UTC