Boost C++ Libraries: Ticket #11872: "std::sprintf" it is normal? https://svn.boost.org/trac10/ticket/11872 <p> In many places of the Boost meets this line: "std::sprintf();". In my case, one of these lines in the file boost/interprocess/detail/win32_api.hpp causes a compilation error in mingw: </p> <pre class="wiki">In file included from /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/atomic.hpp:58:0, from /home/pavel/src/eiskaltdcpp/dcpp/Atomic.h:23, from /home/pavel/src/eiskaltdcpp/dcpp/BufferedSocket.h:28, from /home/pavel/src/eiskaltdcpp/dcpp/HttpConnection.h:21, from /home/pavel/src/eiskaltdcpp/extra/dyndns.h:21, from /home/pavel/src/eiskaltdcpp/extra/dyndns.cpp:19: /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/win32_api.hpp: In function 'bool boost::interprocess::winapi::get_last_bootup_time(std::string&amp;)': /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/win32_api.hpp:2255:19: error: 'libintl_sprintf' is not a member of 'std' std::sprintf(&amp;stamp_str[0], "%u", ((unsigned int)pTypedRecord-&gt;TimeGenerated)); ^ /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/win32_api.hpp:2255:19: note: suggested alternative: In file included from /home/pavel/src/eiskaltdcpp/dcpp/stdinc.h:92:0, from /home/pavel/src/eiskaltdcpp/extra/dyndns.h:20, from /home/pavel/src/eiskaltdcpp/extra/dyndns.cpp:19: /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/libintl.h:362:12: note: 'libintl_sprintf' extern int sprintf (char *, const char *, ...); ^ </pre><p> This compilation error disappears if you remove the prefix "std::". The code contains the string "std::sprintf" enclosed in #ifdef: </p> <pre class="wiki">#ifdef BOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME . . #else . . std::sprintf(&amp;stamp_str[0], "%u", ((unsigned int)pTypedRecord-&gt;TimeGenerated)); . . #endif </pre><p> BOOST_INTERPROCESS BOOTSTAMP_IS_ LASTBOOTUPTIME not defined in mingw. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11872 Trac 1.4.3 bnagaev@… Sun, 27 Dec 2015 15:55:42 GMT <link>https://svn.boost.org/trac10/ticket/11872#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11872#comment:1</guid> <description> <p> See also <a class="ext-link" href="https://github.com/mxe/mxe/issues/1104"><span class="icon">​</span>https://github.com/mxe/mxe/issues/1104</a> </p> </description> <category>Ticket</category> </item> <item> <author>bnagaev@…</author> <pubDate>Sun, 27 Dec 2015 21:47:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11872#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11872#comment:2</guid> <description> <p> C++ defines function std::sprintf: <a class="ext-link" href="http://en.cppreference.com/w/cpp/io/c/fprintf"><span class="icon">​</span>http://en.cppreference.com/w/cpp/io/c/fprintf</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 03 Jan 2016 16:47:11 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/11872#comment:3 https://svn.boost.org/trac10/ticket/11872#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Ion Gaztañaga</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">interprocess</span> </li> </ul> Ticket Ion Gaztañaga Mon, 15 Aug 2016 21:38:58 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11872#comment:4 https://svn.boost.org/trac10/ticket/11872#comment:4 <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">invalid</span> </li> </ul> <p> Reviewing old bugs. boost/interprocess/detail/win32_api.hpp includes &lt;cstdio&gt; which should be enough to have std::sprintf available, it looks like a bug in your mingw environment. </p> Ticket