[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] [Q] How do I remove compilation errors on MinGW?

From: Daiki Ueno
Subject: Re: [bug-gettext] [Q] How do I remove compilation errors on MinGW?
Date: Thu, 16 May 2013 19:23:46 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Sorry for the late response.

> The build failed even with MinGW-w64.

I've just tried self-compile with mingw-w32-bin_i686-mingw_20111219 and
confirmed the issue.  It seems that AC_CHECK_FUNCS cannot detect
snprintf because of a link error if the stdio.h is not included:

$ cat > test-snprintf.c <<EOF
char *snprintf ();
int main () {
  snprintf ();
  return 0;

$ i686-w64-mingw32-gcc -o test-snprintf test-snprintf.c
test-snprintf.c:1:7: warning: conflicting types for built-in function 
'snprintf' [enabled by default]
C:\users\ueno\Temp\ccqF3R3p.o:test-snprintf.c:(.text+0xc): undefined reference 
to `_snprintf'
collect2.exe: error: ld returned 1 exit status

while it succeeds with i686-w64-mingw32-gcc (Fedora 18 MinGW package).

I'm not sure which is the cause of this issue - the toolchain binary is
too old or the toolchain works differently under the self-compilation
setting than cross-compiling.

Anyway, I was easily able to work around this by renaming "snprintf" and
"vsnprintf" symbols in
gettext-tools/gnulib-libs/{snprintf.c,vsnprintf.c} to "unused_snprintf"
and "unused_vsnprintf".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]