Boost C++ Libraries: Ticket #6441: lexical_cast uses non existing std::basic_stringstream<char>::pptr when compiling with -DBOOST_NO_STD_LOCALE https://svn.boost.org/trac10/ticket/6441 <p> BOOST_NO_STD_LOCALE is handled in this context: </p> <pre class="wiki">#if defined(BOOST_NO_STRINGSTREAM) typedef stl_buf_unlocker&lt;std::strstream, CharT &gt; local_stringbuffer_t; #elif defined(BOOST_NO_STD_LOCALE) typedef stl_buf_unlocker&lt;std::stringstream, CharT &gt; local_stringbuffer_t; #else typedef stl_buf_unlocker&lt;std::basic_stringbuf&lt;CharT, Traits&gt;, CharT &gt; local_stringbuffer_t; #endif </pre><p> <strong>but</strong> the stl_buf_unlocker class is using missing methods (pptr, pbase, setg, setp): </p> <pre class="wiki"> namespace detail // stl_buf_unlocker { template&lt; class BufferType, class CharT &gt; class stl_buf_unlocker: public BufferType{ public: typedef BufferType base_class; #ifndef BOOST_NO_USING_TEMPLATE using base_class::pptr; using base_class::pbase; using base_class::setg; using base_class::setp; #else CharT* pptr() const { return base_class::pptr(); } CharT* pbase() const { return base_class::pbase(); } void setg(CharT* gbeg, CharT* gnext, CharT* gend){ return base_class::setg(gbeg, gnext, gend); } void setp(CharT* pbeg, CharT* pend) { return setp(pbeg, pend); } #endif }; } </pre><p> These are the errors from the compiler: </p> <pre class="wiki">./boost/lexical_cast.hpp:1129:31: error: no members matching ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka std::basic_stringstream&lt;char&gt;}::pptr’ in ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka struct std::basic_stringstream&lt;char&gt;}’ ./boost/lexical_cast.hpp:1130:31: error: no members matching ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka std::basic_stringstream&lt;char&gt;}::pbase’ in ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka struct std::basic_stringstream&lt;char&gt;}’ ./boost/lexical_cast.hpp:1131:31: error: no members matching ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka std::basic_stringstream&lt;char&gt;}::setg’ in ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka struct std::basic_stringstream&lt;char&gt;}’ ./boost/lexical_cast.hpp:1132:31: error: no members matching ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka std::basic_stringstream&lt;char&gt;}::setp’ in ‘boost::detail::stl_buf_unlocker&lt;std::basic_stringstream&lt;char&gt;, char&gt;::base_class {aka struct std::basic_stringstream&lt;char&gt;}’ </pre><p> Compiling Boost.Test results in some more errors around this problem. I will attach the complete build log when building Boost.Test to show the compiler flags, too. </p> <p> The error is present in 1.48 and trunk. The log is from the trunk build. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6441 Trac 1.4.3 leutloff@… Mon, 23 Jan 2012 21:21:29 GMT attachment set https://svn.boost.org/trac10/ticket/6441 https://svn.boost.org/trac10/ticket/6441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">error-trunk.log</span> </li> </ul> Ticket John Maddock Sun, 29 Jan 2012 17:58:12 GMT owner changed https://svn.boost.org/trac10/ticket/6441#comment:1 https://svn.boost.org/trac10/ticket/6441#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">nasonov</span> to <span class="trac-author">Antony Polukhin</span> </li> </ul> Ticket Antony Polukhin Mon, 30 Jan 2012 17:18:44 GMT <link>https://svn.boost.org/trac10/ticket/6441#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:2</guid> <description> <p> I`ve successfully compiled and run some tests with all combinations of flags BOOST_NO_STRINGSTREAM and BOOST_NO_STD_LOCALE. No errors. I used gcc-4.6.1, just as you did.<br /> <br /> Looks like you have bad installation of GCCs STL headers.<br /> <br /> Please support more info, so I could reproduce this bug. </p> </description> <category>Ticket</category> </item> <item> <author>leutloff@…</author> <pubDate>Sun, 05 Feb 2012 19:38:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6441#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:3</guid> <description> <p> Hmm, I am puzzled. </p> <p> Here are some more information. I am trying to build on two different 64 bit systems. An up to date Ubuntu and a legacy Debian Lenny system. The legacy Debian system is the reason to use BOOST_NO_STD_LOCALE. But this old system is unfortunately my target system 8-( </p> <p> Okay, here are my findings, starting with the Ubuntu system (Ubuntu 11.10 (GNU/Linux 3.0.0-16-generic x86_64)): </p> <p> Compiling svn trunk (revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/76903" title="Doc update">r76903</a>, 2012-02-05): </p> <ul><li>cd boost-trunk </li><li>(./bootstrap.sh) </li><li>./b2 clean </li><li>./b2 toolset=gcc cxxflags=-DBOOST_NO_STD_LOCALE --with-test stage </li></ul><p> GCC version (gcc --version): </p> <ul><li>gcc (<a class="missing wiki">Ubuntu/Linaro</a> 4.6.1-9ubuntu3) 4.6.1 </li></ul><p> These are the installed STL headers (dpkg -l '*stdc++*-dev'): </p> <ul><li>libstdc++6-4.6-dev, 4.6.1-9ubuntu3, GNU Standard C++ Library v3 (development files) </li></ul><p> This is the only installed libstdc++. (There was an old one installed, but I have removed it and tried again.) </p> <p> Now switching to ancient Debian Lenny system. But the outcome is the same. </p> <p> Executing again: </p> <ul><li>./b2 clean </li><li>./b2 toolset=gcc cxxflags=-DBOOST_NO_STD_LOCALE --with-test stage </li></ul><p> GCC version (gcc --version): </p> <ul><li>gcc (Debian 4.3.2-1.1) 4.3.2 </li></ul><p> These are the installed STL headers (dpkg -l '*stdc++*-dev'): </p> <ul><li>libstdc++6-4.3-dev, 4.3.2-1.1 </li></ul><p> I have no idea what the problem is. So I searched the web for char_type unexpected differences on 32 and 64 bit systems. I have included sstream in libs/test/src/logged_expectations.cpp, but nothing changed (on the Ubuntu system). Any pointers to solve this behavior are greatly appreciated. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Mon, 06 Feb 2012 16:24:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6441#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6441#comment:3" title="Comment 3">leutloff@…</a>: </p> <blockquote class="citation"> <p> Here are some more information. I am trying to build on two different 64 bit systems. An up to date Ubuntu and a legacy Debian Lenny system. The legacy Debian system is the reason to use BOOST_NO_STD_LOCALE. But this old system is unfortunately my target system 8-( </p> </blockquote> <p> BOOST_NO_STD_LOCALE is an internal define, that describes STL library defects. It must be set up by boost/config.hpp. I don`t think that BOOST_NO_STD_LOCALE is meant to be used this way.<br /> <br /> Why are you explicitly specifying it? </p> </description> <category>Ticket</category> </item> <item> <author>leutloff@…</author> <pubDate>Tue, 07 Feb 2012 13:30:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6441#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:5</guid> <description> <blockquote class="citation"> <p> Why are you explicitly specifying it? </p> </blockquote> <p> std::locale("") throws an exception on the old system (libstdc++6, 4.3.2). Therefore I must ensure that locale is not instantiated. Defining BOOST_NO_STD_LOCALE avoided the exception for some of the boost libraries I am using (I suppose it was thread and regex). I have read that defining BOOST_NO_STD_LOCALE is the correct way to avoid the std::locale instantiation. But I can not find the documents for reference at the moment 8-( </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Tue, 07 Feb 2012 17:08:52 GMT</pubDate> <title>status, milestone changed; cc set https://svn.boost.org/trac10/ticket/6441#comment:6 https://svn.boost.org/trac10/ticket/6441#comment:6 <ul> <li><strong>cc</strong> <span class="trac-author">antoshkka@…</span> added </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> </ul> <p> I`ve reproduced the error.<br /> Thanks for bug report and additional info! </p> Ticket Antony Polukhin Mon, 20 Feb 2012 16:20:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6441#comment:7 https://svn.boost.org/trac10/ticket/6441#comment:7 <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-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77077" title="Fixes #6441 (compilation error with BOOST_NO_STD_LOCALE defined)">[77077]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6441" title="#6441: Bugs: lexical_cast uses non existing std::basic_stringstream&lt;char&gt;::pptr ... (closed: fixed)">#6441</a> (compilation error with BOOST_NO_STD_LOCALE defined) </p> Ticket Antony Polukhin Mon, 20 Feb 2012 16:25:46 GMT <link>https://svn.boost.org/trac10/ticket/6441#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:8</guid> <description> <p> Now it compiles with BOOST_NO_STD_LOCALE, but I think that your error can occur at any time: all the STL streams use std::locale. May be a better solution in your case would be to update GCC. </p> </description> <category>Ticket</category> </item> <item> <author>leutloff@…</author> <pubDate>Mon, 20 Feb 2012 21:45:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6441#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:9</guid> <description> <p> Thanks a lot for fixing this issue! I wish I could change GCC - I would have done it instead of writing this issue - BUT there is no way for me to change it 8-( </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sat, 25 Feb 2012 17:32:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6441#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6441#comment:10</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77117" title="Update for fixed #6441 (unable to compile lexical_cast with ...">[77117]</a>) Update for fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6441" title="#6441: Bugs: lexical_cast uses non existing std::basic_stringstream&lt;char&gt;::pptr ... (closed: fixed)">#6441</a> (unable to compile lexical_cast with BOOST_NO_STD_LOCALE defined) Now test must compile under VC, removed some warnings. </p> </description> <category>Ticket</category> </item> </channel> </rss>