Skip to content
Prev 35840 / 63424 Next

wcstombs error when compiling package with Debian/Ubuntu

Such errors are common when people use older versions of g++ to write 
their C++ code.  Later versions of g++ have somewhat stricter 
conformance to the C++ standards and catch some lax usage: we've seen 
it quite a lot for g++ 4.4.x and even more for pre-4.5.0.  In all the 
cases I have seen this message indicates a missing header.

wcstombs is a C99 function declared in <stdlib.h>: given that this 
looks like a C++ error message, did you include its C++ version, 
<cstdlib>?

Note that Mac OS X and (32-bit) WinXP are using g++ 4.2.x.  Also, what 
other headers a particular header includes is OS-dependent (and maybe 
even compiler-dependent): we have had a lot of trouble recently with 
<stdint.h> that some OSes (especially MinGW32) include from more 
common headers and some do not.

So this may be an OS issue but a compiler-version issue is more 
likely.
On Wed, 10 Feb 2010, cstrato wrote: