Boost C++ Libraries: Ticket #6251: mingw gcc-4.5.0 compiler error: Undeclared swprintf https://svn.boost.org/trac10/ticket/6251 <pre class="wiki">gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-mingw-4.5.0x\debug\link-static\threading-multi\exception_safety.o In file included from ..\..\../boost/test/interaction/interaction_based.hpp:27:0, from ..\..\../boost/test/impl/exception_safety.ipp:29, from ..\..\..\libs\test\src\exception_safety.cpp:16: ..\..\../boost/lexical_cast.hpp: In member function 'bool boost::detail::lexical_stream_limited_src&lt;CharT, Traits, RequiresStringbuffer&gt;::shl_float(float, wchar_t*)': ..\..\../boost/lexical_cast.hpp:1248:120: error: there are no arguments to 'swprintf' that depend on a template parameter, so a declaration of 'swprintf' must be available ..\..\../boost/lexical_cast.hpp:1248:120: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) ..\..\../boost/lexical_cast.hpp: In member function 'bool boost::detail::lexical_stream_limited_src&lt;CharT, Traits, RequiresStringbuffer&gt;::shl_double(double, wchar_t*)': ..\..\../boost/lexical_cast.hpp:1269:122: error: there are no arguments to 'swprintf' that depend on a template parameter, so a declaration of 'swprintf' must be available "c:/MINGW/bin/g++" -ftemplate-depth-128 -std=c++0x -O0 -fno-inline -Wall -pedantic -g -mthreads -DBOOST_ALL_NO_LIB=1 -I"..\..\.." -c -o "..\..\..\bin.v2\libs\test\build\gcc-mingw-4.5.0x\debug\link-static\threading-multi\exception_safety.o" "..\..\..\libs\test\src\exception_safety.cpp" </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6251 Trac 1.4.3 Antony Polukhin Tue, 17 Jan 2012 18:29:09 GMT owner, status, version changed https://svn.boost.org/trac10/ticket/6251#comment:1 https://svn.boost.org/trac10/ticket/6251#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">nasonov</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.48.0</span> → <span class="trac-field-new">Boost 1.49.0</span> </li> </ul> <p> This looks like a mingw bug. It has been <a class="ext-link" href="http://sourceforge.net/tracker/?func=detail&amp;aid=2373234&amp;group_id=2435&amp;atid=102435"><span class="icon">​</span>reported</a> and looks like it is fixed (at least it is not reproduced at mingw-4.5.2_0x).<br /> </p> <p> <a class="ext-link" href="http://sourceforge.net/tracker/?func=detail&amp;aid=2373234&amp;group_id=2435&amp;atid=102435"><span class="icon">​</span>Workaround</a> was proposed: </p> <pre class="wiki">#if (defined(__MINGW32__) || defined(__MINGW64__)) &amp;&amp; (__GNUC__ == 4) // workaround a mingw bug, http://sourceforge.net/tracker/index.php?func=detail&amp;aid=2373234&amp;group_id=2435&amp;atid=102435 int swprintf (wchar_t *, size_t, const wchar_t *, ...); #endif </pre><p> (must be added to lexical_cast.hpp after #includes ao before the inclusion of lexical_cast.hpp)<br /> <br /> I`ll test it on mingw by myself and then apply to trunk. </p> Ticket Antony Polukhin Fri, 20 Jan 2012 19:33:07 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6251#comment:2 https://svn.boost.org/trac10/ticket/6251#comment:2 <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/76599" title="Attempt to fix #6251">[76599]</a>) Attempt to fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6251" title="#6251: Bugs: mingw gcc-4.5.0 compiler error: Undeclared swprintf (closed: fixed)">#6251</a> </p> Ticket Antony Polukhin Sat, 04 Feb 2012 18:04:48 GMT <link>https://svn.boost.org/trac10/ticket/6251#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6251#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76887" title="Merge from trunk (fixed #6251, fixed #6453, disabled some ...">[76887]</a>) Merge from trunk (fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6251" title="#6251: Bugs: mingw gcc-4.5.0 compiler error: Undeclared swprintf (closed: fixed)">#6251</a>, fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6453" title="#6453: Bugs: Compile error due to `deduce_char_traits` ambiguity (closed: fixed)">#6453</a>, disabled some optimizations for sunCC <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6462" title="#6462: Bugs: lexical_cast fails on Linux with Sun CC (closed: fixed)">#6462</a>) </p> </description> <category>Ticket</category> </item> </channel> </rss>