Boost C++ Libraries: Ticket #10535: Multiply Defined Symbols in serialization/wserialization https://svn.boost.org/trac10/ticket/10535 <p> 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). </p> <p> I solved the problem by changing this two files and rebuilding boost: </p> <p> <em> basic_text_iprimitive.ipp: </em></p> <blockquote> <p> template&lt;&gt; bool is_whitespace(char t); </p> </blockquote> <p> <em> { </em> return 0 != std::isspace(t); <em> } </em></p> <blockquote> <p> #ifndef BOOST_NO_CWCHAR template&lt;&gt; bool is_whitespace(wchar_t t); </p> </blockquote> <p> <em> { </em> return 0 != std::iswspace(t); <em> } </em></p> <blockquote> <p> #endif </p> </blockquote> <p> } <em> detail </em></p> <p> <em> basic_text_iprimitive.cpp: </em></p> <p> namespace detail { </p> <blockquote> <p> template&lt;class <a class="missing wiki">CharType</a>&gt; bool is_whitespace(<a class="missing wiki">CharType</a> c); </p> </blockquote> <blockquote> <p> template&lt;&gt; bool is_whitespace(char t) { </p> <blockquote> <p> return 0 != std::isspace(t); </p> </blockquote> <p> } </p> </blockquote> <blockquote> <p> #ifndef BOOST_NO_CWCHAR template&lt;&gt; bool is_whitespace(wchar_t t) { </p> <blockquote> <p> return 0 != std::iswspace(t); </p> </blockquote> <p> } #endif </p> </blockquote> <p> } <em> detail </em></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10535 Trac 1.4.3 Robert Ramey Fri, 26 Sep 2014 17:38:20 GMT <link>https://svn.boost.org/trac10/ticket/10535#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10535#comment:1</guid> <description> <pre class="wiki">namespace detail { template&lt;class CharType&gt; bool is_whitespace(CharType c); template&lt;&gt; bool is_whitespace(char t){ return 0 != std::isspace(t); } #ifndef BOOST_NO_CWCHAR template&lt;&gt; bool is_whitespace(wchar_t t){ return 0 != std::iswspace(t); } #endif } // detail </pre><p> This is what my code in *.ipp already looks like - I don't understand the proposed change in *.cpp - doesn't look like the correct fix to me. </p> <p> It seems to me that the symptom is multiply defined symbols in basic_text_iprimitive.ipp. Since this is old code - I'm guessing that the newer linker/managed code, etc is pickier. Even though the functions are inline - it looks like they are being linked with external linkage - I'll consider this. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 26 Sep 2014 17:49:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10535#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10535#comment:2</guid> <description> <pre class="wiki">namespace detail { template&lt;class CharType&gt; static inline bool is_whitespace(CharType c); template&lt;&gt; inline bool is_whitespace(char t){ return 0 != std::isspace(t); } #ifndef BOOST_NO_CWCHAR template&lt;&gt; inline bool is_whitespace(wchar_t t){ return 0 != std::iswspace(t); } #endif } // detail </pre><p> I think that the above is the right fix - how does that work for you? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 29 Oct 2014 15:36:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10535#comment:3 https://svn.boost.org/trac10/ticket/10535#comment:3 <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> Ticket