Boost C++ Libraries: Ticket #878: error C2039: 'mbstate_t' : is not a member of 'std' https://svn.boost.org/trac10/ticket/878 <pre class="wiki">I have been working on the Apache C++ Standard Library project (STDCXX): http://incubator.apache.org/stdcxx/ I've trying to compile the boost library with stdcxx. The details can be found here: http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200704.mbox/% 3c7BDB2168BEAEF14C98F1901FD2DE64386573EB@epmsa009.minsk.epam.com%3e Boost version: 1.33.1 STDCXX version: 4.2 I've got the following error in boost/detail/utf8_codecvt_facet.hpp; boost/archive/codecvt_null.hpp: D:\_Libs\boost_1_33_1\boost\detail\utf8_codecvt_facet.hpp(116) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost\detail\utf8_codecvt_facet.hpp(124) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost\detail\utf8_codecvt_facet.hpp(134) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost\detail\utf8_codecvt_facet.hpp(163) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost\detail\utf8_codecvt_facet.hpp(181) : error C2039: 'mbstate_t' : is not a member of 'std' d:\_Libs\boost_1_33_1\libs\program_options\src\../../detail\utf8_codecvt_facet.cpp(35) : error C2039: 'mbstate_t' : is not a member of 'std' d:\_Libs\boost_1_33_1\libs\program_options\src\../../detail\utf8_codecvt_facet.cpp(112) : error C2039: 'mbstate_t' : is not a member of 'std' d:\_Libs\boost_1_33_1\libs\program_options\src\../../detail\utf8_codecvt_facet.cpp(174) : error C2039: 'mbstate_t' : is not a member of 'std' CALL "C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" &gt;nul "C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\bin\cl" /Zm800 -nologo /EHsc -c -D_RWSTDDEBUG /Z7 /Od /Ob0 /EHsc /GR /MTd /Op /wd4675 /Zc:forScope -I"bin\boost\libs\program_options\build" -I"D:\_Libs\boost_1_33_1" -I"D:\_Projects\stdcxx_working\include" -I"D:\_Projects\stdcxx_working\include\ansi" -I"D:\_Projects\stdcxx_working\build\msvc-7.1\15s\include" -I"D:\_Libs\boost_1_33_1" -Fo"bin\boost\libs\program_options\build\libboost_program_options.lib\vc-7_1-stdcxx\debug\runtime-link-static\threading-multi\utf8_codecvt_facet.obj" -Tp"D:\_Libs\boost_1_33_1\libs\program_options\build\../src/utf8_codecvt_facet.cpp" D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(45) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(45) : error C2065: 'mbstate_t' : undeclared identifier D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(46) : error C2955: 'std::codecvt' : use of class template requires template argument list D:\_Projects\stdcxx_working\include\loc/_codecvt.h(164) : see declaration of 'std::codecvt' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(57) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(58) : error C2955: 'std::codecvt' : use of class template requires template argument list D:\_Projects\stdcxx_working\include\loc/_codecvt.h(164) : see declaration of 'std::codecvt' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(61) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(61) : error C2061: syntax error : identifier 'mbstate_t' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(71) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(71) : error C2061: syntax error : identifier 'mbstate_t' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(52) : error C2039: 'mbstate_t' : is not a member of 'std' D:\_Libs\boost_1_33_1\boost/archive/codecvt_null.hpp(53) : error C2542: 'codecvt' : class object has no constructor for initialization CALL "D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\..\..\VC\bin\vcvars32.BAT" &gt;nul "D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\..\..\VC\bin\cl" /Zm800 -nologo /EHsc -c -DBOOST_LIB_DIAGNOSTIC=1 -D_RWSTDDEBUG /Z7 /Od /Ob0 /EHsc /GR /MTd -Gy -wd4996 /Zc:forScope /Zc:wchar_t -I"bin\boost\libs\serialization\build" -I"D:\_Projects\stdcxx_working\include" -I"D:\_Projects\stdcxx_working\include\ansi" -I"D:\_Projects\stdcxx_working\build\msvc-8.0\15s\include" -I"D:\_Libs\boost_1_33_1" -Fo"bin\boost\libs\serialization\build\libboost_serialization.lib\vc-8_0-stdcxx\debug\runtime-link-static\threading-multi\basic_text_iprimitive.obj" -Tp"D:\_Libs\boost_1_33_1\libs\serialization\build\../src/basic_text_iprimitive.cpp" I propose to #include &lt;wchar.h&gt; in codecvt_null.hpp and add the following lines in both files: #elif defined(BOOST_RWSTD_VER) using ::mbstate_t; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/878 Trac 1.4.3 anonymous Fri, 01 Jun 2007 15:50:38 GMT <link>https://svn.boost.org/trac10/ticket/878#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/878#comment:1</guid> <description> <p> I've added this to my local version for testing. Assuming no problems, it will appear in 1.35 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>farid_zaripov</dc:creator> <pubDate>Tue, 05 Jun 2007 17:11:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/878#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/878#comment:2</guid> <description> <p> The cross-reference link to the Apache STDCXX issue tracker: <a class="ext-link" href="http://issues.apache.org/jira/browse/STDCXX-430"><span class="icon">​</span>http://issues.apache.org/jira/browse/STDCXX-430</a> </p> </description> <category>Ticket</category> </item> <item> <author>farid_zaripov <faridz@…></author> <pubDate>Tue, 19 Jun 2007 17:40:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/878#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/878#comment:3</guid> <description> <p> May I hope that the changes will appear in 1.34.1? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Thu, 01 Nov 2007 18:25:37 GMT</pubDate> <title>status, resolution changed; severity set https://svn.boost.org/trac10/ticket/878#comment:4 https://svn.boost.org/trac10/ticket/878#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Showstopper</span> </li> </ul> Ticket faridz@… Mon, 21 Jan 2008 22:07:50 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/878#comment:5 https://svn.boost.org/trac10/ticket/878#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Ticked fixed not completely: </p> <pre class="wiki">..\boost\archive\codecvt_null.hpp(37) : error C2039: 'mbstate_t' : is not a member of 'operator``global namespace''' ..\boost\archive\codecvt_null.hpp(37) : error C2873: 'mbstate_t' : symbol cannot be used in a using-declaration ..\boost\archive\codecvt_null.hpp(48) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost\archive\codecvt_null.hpp(48) : error C2065: 'mbstate_t' : undeclared identifier ..\boost\archive\codecvt_null.hpp(48) : error C2955: 'std::codecvt' : use of class template requires template argument list D:\stdcxx\4.2.x\include\loc\_codecvt.h(171) : see declaration of 'std::codecvt' ..\boost\archive\codecvt_null.hpp(60) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost\archive\codecvt_null.hpp(60) : error C3861: 'mbstate_t': identifier not found, even with argument-dependent lookup ..\boost\archive\codecvt_null.hpp(60) : error C2955: 'std::codecvt' : use of class template requires template argument list D:\stdcxx\4.2.x\include\loc\_codecvt.h(171) : see declaration of 'std::codecvt' ..\boost\archive\codecvt_null.hpp(64) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost\archive\codecvt_null.hpp(64) : error C2061: syntax error : identifier 'mbstate_t' ..\boost\archive\codecvt_null.hpp(74) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost\archive\codecvt_null.hpp(74) : error C2061: syntax error : identifier 'mbstate_t' </pre><p> The patch: </p> <pre class="wiki">Index: boost/archive/codecvt_null.hpp =================================================================== --- boost/archive/codecvt_null.hpp (revision 42906) +++ boost/archive/codecvt_null.hpp (working copy) @@ -18,6 +18,7 @@ #include &lt;locale&gt; #include &lt;cstddef&gt; +#include &lt;wchar.h&gt; // for mbstate_t #include &lt;boost/config.hpp&gt; #include &lt;boost/archive/detail/auto_link_archive.hpp&gt; </pre> Ticket faridz@… Tue, 22 Jan 2008 10:08:10 GMT <link>https://svn.boost.org/trac10/ticket/878#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/878#comment:6</guid> <description> <blockquote> <p> The error in utf8_codecvt_facet.hpp: </p> <pre class="wiki">utf8_codecvt_facet.cpp ..\boost/detail/utf8_codecvt_facet.hpp(114) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost/detail/utf8_codecvt_facet.hpp(122) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost/detail/utf8_codecvt_facet.hpp(132) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost/detail/utf8_codecvt_facet.hpp(161) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost/detail/utf8_codecvt_facet.hpp(179) : error C2039: 'mbstate_t' : is not a member of 'std' ..\boost/detail/utf8_codecvt_facet.hpp(117) : error C2039: 'mbstate_t' : is not a member of 'std' ..\libs/detail/utf8_codecvt_facet.cpp(35) : error C2039: 'mbstate_t' : is not a member of 'std' ..\libs/detail/utf8_codecvt_facet.cpp(112) : error C2039: 'mbstate_t' : is not a member of 'std' ..\libs/detail/utf8_codecvt_facet.cpp(174) : error C2039: 'mbstate_t' : is not a member of 'std' </pre></blockquote> <blockquote> <p> The patch: </p> </blockquote> <pre class="wiki">Index: boost/detail/utf8_codecvt_facet.hpp =================================================================== --- boost/detail/utf8_codecvt_facet.hpp (revision 42908) +++ boost/detail/utf8_codecvt_facet.hpp (working copy) @@ -96,6 +96,8 @@ #elif defined(BOOST_NO_STDC_NAMESPACE) using ::mbstate_t; using ::codecvt; + #elif defined(BOOST_RWSTD_VER) + using ::mbstate_t; #endif } // namespace std </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 23 Jan 2008 17:39:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/878#comment:7 https://svn.boost.org/trac10/ticket/878#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> OK - I made the change in my local system. </p> <p> Should appear on Boost 1.36 </p> Ticket