Boost C++ Libraries: Ticket #11541: Building with /Zc:wchar_t- on VC causes errors in boost::log since 1.59.0 https://svn.boost.org/trac10/ticket/11541 <p> Boost 1.58.0 and earlier could be built successfully with '/Zc:wchar_t-' (no native wchar_t type) set. Since boost 1.59.0 this causes template errors in boost log. More specifically in code_conversion.hpp . I'm not quite clear on whether boost is actually interested in being able to build with this flag enabled in the first place, however I won't be the only one seeing this regression as it isn't unusual for this flag to be present in Windows projects. For example Qt was built with it throughout the 4.X series and most old systems with some MFC dependency set it at some point to retain binary compatibility. </p> <p> Here one of the error messages from Visual Studio 2013 (VC12) for reference (looks pretty much the same for VC14): </p> <pre class="wiki">.\boost/log/detail/code_conversion.hpp(114) : error C2784: 'boost::enable_if_c&lt;boost::log::v2s_mt_nt5::aux::is_character_type&lt;T&gt;::value&amp;&amp;boost::log::v2s_mt_nt5::aux::is_character_type&lt;TargetCharT&gt;::value&amp;&amp;sizeof(SourceCharT)!=sizeof(TargetCharT),void&gt;::type boost::log::v2s_mt_nt5::aux::code_convert(const SourceCharT *,size_t,std::basic_string&lt;TargetCharT,TargetTraitsT,TargetAllocatorT&gt; &amp;,const std::locale &amp;)' : could not deduce template argument for 'const SourceCharT *' from 'const std::wstring' .\boost/log/detail/code_conversion.hpp(93) : see declaration of 'boost::log::v2s_mt_nt5::aux::code_convert' .\boost/log/detail/code_conversion.hpp(114) : error C2893: Failed to specialize function template 'boost::enable_if_c&lt;boost::log::v2s_mt_nt5::aux::is_character_type&lt;T&gt;::value&amp;&amp;boost::log::v2s_mt_nt5::aux::is_character_type&lt;TargetCharT&gt;::value&amp;&amp;sizeof(SourceCharT)!=sizeof(TargetCharT),void&gt;::type boost::log::v2s_mt_nt5::aux::code_convert(const std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;,std::basic_string&lt;TargetCharT,TargetTraitsT,TargetAllocatorT&gt; &amp;,const std::locale &amp;)' With the following template arguments: 'SourceCharT=wchar_t' 'SourceTraitsT=std::char_traits&lt;wchar_t&gt;' 'SourceAllocatorT=std::allocator&lt;wchar_t&gt;' 'TargetCharT=char' 'TargetTraitsT=std::char_traits&lt;char&gt;' 'TargetAllocatorT=std::allocator&lt;char&gt;' </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11541 Trac 1.4.3 dd0t@… Mon, 17 Aug 2015 13:12:54 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11541#comment:1 https://svn.boost.org/trac10/ticket/11541#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrey Semashev</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">log</span> </li> </ul> Ticket Andrey Semashev Sun, 23 Aug 2015 17:39:35 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11541#comment:2 https://svn.boost.org/trac10/ticket/11541#comment:2 <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> Fixed in <a class="ext-link" href="https://github.com/boostorg/log/commit/44ef1095051f389931693f5117e404ffe22b9a56"><span class="icon">​</span>https://github.com/boostorg/log/commit/44ef1095051f389931693f5117e404ffe22b9a56</a>. </p> <p> To answer your question about emulated <code>wchar_t</code> support, I don't think there's much will to support it as this behavior is non-conforming (read: adds unnecessary problems) and can be relatively easily fixed with a compiler switch. Boost itself is built with the native <code>wchar_t</code> enabled, and this has been so for many years. Additionally, there are no testers with emulated <code>wchar_t</code>, so expect breakages. </p> <p> With respect to Boost.Log, the emulated <code>wchar_t</code> is problematic as it makes certain parts of the library behave differently than normal. I added a note to the docs stating that. For now I fixed the compilation but in the future I may remove support for emulated <code>wchar_t</code> completely. I highly recommend switching to the native <code>wchar_t</code>. </p> Ticket dd0t@… Tue, 25 Aug 2015 09:01:02 GMT <link>https://svn.boost.org/trac10/ticket/11541#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11541#comment:3</guid> <description> <p> Thanks for the quick fix. We are removing the flag with our transition to vc14. Since 1.59.0 is the first boost version to support that compiler being able to compile it with out legacy configuration and compiler makes handling the transition in our dependency management a easier. </p> </description> <category>Ticket</category> </item> </channel> </rss>