Mail Archives: djgpp/2013/04/03/18:00:23
On 02.04.2013 18:44, Eli Zaretskii wrote:
>> Date: Tue, 02 Apr 2013 18:07:35 -0800
>> From: Mikhail Ryazanov <ryazanov AT usc DOT edu>
>>
>> I have a problem compiling programs with snprintf (actually, vsnprintf)
>> function. Although it is described in the documentation
>> [http://www.delorie.com/djgpp/doc/libc/libc_732.html] and is present in
>> the provided header files, a simple test program
...
>> fails to compile both in C++ mode:
>>
>> ... error: 'snprintf' was not declared in this scope
>>
>> (playing with <cstdio> and various possible scopes does not help) and in C:
...
>
> snprintf is only available in (yet unreleased) version v2.04 of the
> library. Are you using that, or do you have v2.03 installed? If the
> latter, then indeed there's no snprintf.
Thanks for the explanation!
I have v2.03, as zip-picker suggested. How usable is v2.04 now?
>> I found a probably related discussion at
>> [http://cygwin.com/ml/cygwin/2012-04/msg00140.html] (about one year
>> ago), but it seems that there the problem was only for particular
>> "-std=" choices, whereas current DJGPP fails with _any_ kind of C/C++
>> standard (including "gnu...").
>
> Cygwin is not related to DJGPP.
Well, their problem was in conditionals in header files, so I guessed
that this might be related, since, as I said above, snprintf _is_
declared (also inside some conditional) in cstdio from gpp472b.zip that
I am using.
>> P.S. For comparison, gcc 4.6.1 in Debian works fine.
> GCC version has nothing to do with this. Standard functions are
> implemented in the library, not in the compiler.
I understand, but they must be not only implemented in the library, but
also declared in library header files, which in turn have some
correlation with the compiler. At least, "4.72" in the path
DJGPP/include/cxx/4.72/cstdio
suspiciously resembles "4.7.2" in the output of
"DJGPP/bin/gcc.exe --version". ;-)
So, back to v2.03/v2.04. Currently the problem in C++ occurs even before
that linker cannot find snprintf in the library -- the compiler simply
does not see its declaration. If I replace djdev203 with djdev204, will
it start seeing? Or I need to update gpp as well?
--
Best regards,
Mikhail Ryazanov
- Raw text -