Boost logo

Boost Users :

Subject: [Boost-users] [lexical_cast] Compilation issues with gcc 4.6 -std=c++0x
From: Scott Meyers (NeverRead_at_[hidden])
Date: 2011-11-15 21:04:09


With 1.48 on 64-bit Windows 7 and gcc 4.6.0, the following code fails to
compile with -std=c++0x:

   #include <boost/lexical_cast.hpp>
   int main(){}

The diagnostics are:

C:\Users\Scott\Libraries\Boost\Current/boost/lexical_cast.hpp: In member
function 'bool boost::detail::lexical_stream_limited_src<Ch
arT, Traits, RequiresStringbuffer>::shl_float(float, wchar_t*)':
C:\Users\Scott\Libraries\Boost\Current/boost/lexical_cast.hpp:1210:120:
error: there are no arguments to 'swprintf' that depend on a
  template parameter, so a declaration of 'swprintf' must be available
[-fpermissive]
C:\Users\Scott\Libraries\Boost\Current/boost/lexical_cast.hpp:1210:120:
note: (if you use '-fpermissive', G++ will accept your code,
  but allowing the use of an undeclared name is deprecated)
C:\Users\Scott\Libraries\Boost\Current/boost/lexical_cast.hpp: In member
function 'bool boost::detail::lexical_stream_limited_src<Ch
arT, Traits, RequiresStringbuffer>::shl_double(double, wchar_t*)':
C:\Users\Scott\Libraries\Boost\Current/boost/lexical_cast.hpp:1231:122:
error: there are no arguments to 'swprintf' that depend on a
  template parameter, so a declaration of 'swprintf' must be available
[-fpermissive]

The code compiles fine without -std=c++0x. I don't recall having this
problem with earlier releases.

Pilot error or library implementation problem?

Thanks,

Scott


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net