[Rd] wcstombs error when compiling package with Debian/Ubuntu

cstrato cstrato at aon.at
Thu Feb 11 00:08:11 CET 2010


Dear Prof. Ripley,

Thank you for this extensive explanation.

The compiler version of OpenSUSE11.1 is "gcc version 4.3.2" whereas 
Ubuntu uses "gcc 4.4.1". Interestingly, the first complaint was a Debian 
testing (squeeze) user with "gcc-4.3".

Since my package depends on ROOT I have assumed that <stdlib.h> was 
declared in their headers, which is only the case for Sun. Thus it seems 
that I need to add <cstdlib> to my respective implementation files.

Best regards
Christian


Prof Brian Ripley wrote:
> 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:
>
>> Dear Debian/Ubuntu experts,
>>
>> For the second time users of my BioC package reported problems when 
>> trying to compile it on Debian/Ubuntu.
>>
>> The error is always the same: "'wcstombs' was not declared in this 
>> scope", see:
>> https://www.stat.math.ethz.ch/pipermail/bioconductor/2010-February/031739.html 
>>
>> https://stat.ethz.ch/pipermail/bioconductor/2009-August/029192.html
>>
>> Since I have no problems compiling my package on OpenSUSE11.1, MacOS 
>> X and WinXP, I assume that maybe some development package may not be 
>> installed?
>>
>> Do you know what might be the reason for the compilation error on 
>> Debian/Ubuntu?
>> Which development headers/packages (glibc-headers, 
>> glibc-kernheaders??) need to be installed on Debian/Ubuntu?
>>
>> Best regards
>> Christian
>> _._._._._._._._._._._._._._._._._._
>> C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
>> V.i.e.n.n.a           A.u.s.t.r.i.a
>> e.m.a.i.l:        cstrato at aon.at
>> _._._._._._._._._._._._._._._._._._
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>



More information about the R-devel mailing list