Problems Linking with Boost Serialization

I have found this on boost 1.56 with msvc12:
Error 119 error LNK2005: "bool __cdecl
boost::archive::detail::is_whitespace<char>(char)" (??$is_whitespace@D
@detail@archive@boost@@YA_ND@Z) already defined in
libboost_wserialization-vc120-mt-1_56.lib(basic_text_wiprimitive.obj)
C:\supernova\sb6\src\supernova_clr\libboost_serialization-vc120-mt-1_56.lib(basic_text_iprimitive.obj)
Error 120 error LNK2005: "bool __cdecl
boost::archive::detail::is_whitespace

I have found what I think is a problem with
basic_text_iprimitive/wiprimitive. When linking a windows clr dll (may
happen with other configurations too), if you use both serialization and
wserialization you should not be able to link because of a couple of
symbols defined across two different modules (is_whitespace(char) and
is_whitespace(wchar_t) in basic_text_iprimitive and basic_text_wiprimitive).
I solved the problem by changing this two files and rebuilding boost:
// basic_text_iprimitive.ipp:
template<>
bool is_whitespace(char t);
// {
// return 0 != std::isspace(t);
// }
#ifndef BOOST_NO_CWCHAR
template<>
bool is_whitespace(wchar_t t);
// {
// return 0 != std::iswspace(t);
// }
#endif
} // detail
// basic_text_iprimitive.cpp:
namespace detail {
template<class CharType>
bool is_whitespace(CharType c);
template<>
bool is_whitespace(char t)
{
return 0 != std::isspace(t);
}
#ifndef BOOST_NO_CWCHAR
template<>
bool is_whitespace(wchar_t t)
{
return 0 != std::iswspace(t);
}
#endif
} // detail
Regards.
2014-09-16 6:32 GMT+02:00 Isaac Lascasas

Isaac Lascasas-2 wrote
Please open a trac item with information so I don't forget it. -- View this message in context: http://boost.2283326.n4.nabble.com/Problems-Linking-with-Boost-Serialization... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Isaac Lascasas
-
Robert Ramey