[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getaddrinfo on MinGW
From: |
Ludovic Courtès |
Subject: |
getaddrinfo on MinGW |
Date: |
Sun, 03 Jul 2011 17:09:37 +0200 |
User-agent: |
Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux) |
Hello,
The ‘getaddrinfo’ module doesn’t seem to work as advertised ;-) when
cross-building for MinGW.
>From <http://hydra.nixos.org/build/1140382>, a file that includes
Gnulib’s <netdb.h> fails to build like this:
--8<---------------cut here---------------start------------->8---
/bin/sh ../libtool --tag=CC --mode=compile i686-pc-mingw32-gcc
-DHAVE_CONFIG_H -DBUILDING_LIBGUILE=1 -I../../guile-2.0.1.154-f3977 -I..
-I../../guile-2.0.1.154-f3977/lib -I../lib
-I/nix/store/hwd5i31rikwdjmjhxn4d2xwlsxczsg0s-libffi-3.0.9-i686-pc-mingw32/lib/libffi-3.0.9/include
-I/nix/store/lqyvgsv21wmf15xnznwv5qi78p59zkfm-libunistring-0.9.3-i686-pc-mingw32/include
-Wall -Wmissing-prototypes -Wdeclaration-after-statement -Wswitch-enum
-fvisibility=hidden
-I/nix/store/lli7w1b3kc5nwdwgq9c9ikhdx141bba4-boehm-gc-7.2pre20110122-i686-pc-mingw32/include
-g -O2 -c -o net_db.lo ../../guile-2.0.1.154-f3977/libguile/net_db.c
libtool: compile: i686-pc-mingw32-gcc -DHAVE_CONFIG_H -DBUILDING_LIBGUILE=1
-I../../guile-2.0.1.154-f3977 -I.. -I../../guile-2.0.1.154-f3977/lib -I../lib
-I/nix/store/hwd5i31rikwdjmjhxn4d2xwlsxczsg0s-libffi-3.0.9-i686-pc-mingw32/lib/libffi-3.0.9/include
-I/nix/store/lqyvgsv21wmf15xnznwv5qi78p59zkfm-libunistring-0.9.3-i686-pc-mingw32/include
-Wall -Wmissing-prototypes -Wdeclaration-after-statement -Wswitch-enum
-fvisibility=hidden
-I/nix/store/lli7w1b3kc5nwdwgq9c9ikhdx141bba4-boehm-gc-7.2pre20110122-i686-pc-mingw32/include
-g -O2 -c ../../guile-2.0.1.154-f3977/libguile/net_db.c -o net_db.o
../../guile-2.0.1.154-f3977/libguile/net_db.c:460:1: error: 'AI_ALL' undeclared
here (not in a function)
../../guile-2.0.1.154-f3977/libguile/net_db.c:460:1: error: bit-field
'_gl_verify_error_if_negative' width not an integer constant
../../guile-2.0.1.154-f3977/libguile/net_db.c:482:33: warning: 'struct
addrinfo' declared inside parameter list
../../guile-2.0.1.154-f3977/libguile/net_db.c:482:33: warning: its scope is
only this definition or declaration, which is probably not what you want
../../guile-2.0.1.154-f3977/libguile/net_db.c: In function 'scm_from_addrinfo':
../../guile-2.0.1.154-f3977/libguile/net_db.c:490:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:491:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:492:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:493:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:494:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:494:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:496:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:496:3: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c: In function 'scm_getaddrinfo':
../../guile-2.0.1.154-f3977/libguile/net_db.c:614:19: error: storage size of
'c_hints' isn't known
../../guile-2.0.1.154-f3977/libguile/net_db.c:657:3: warning: implicit
declaration of function 'getaddrinfo'
../../guile-2.0.1.154-f3977/libguile/net_db.c:665:10: error: dereferencing
pointer to incomplete type
../../guile-2.0.1.154-f3977/libguile/net_db.c:665:19: warning: left-hand
operand of comma expression has no effect
../../guile-2.0.1.154-f3977/libguile/net_db.c:666:2: warning: passing argument
1 of 'scm_from_addrinfo' from incompatible pointer type
../../guile-2.0.1.154-f3977/libguile/net_db.c:482:1: note: expected 'const
struct addrinfo *' but argument is of type 'struct addrinfo *'
../../guile-2.0.1.154-f3977/libguile/net_db.c:668:7: warning: implicit
declaration of function 'freeaddrinfo'
../../guile-2.0.1.154-f3977/libguile/net_db.c:614:19: warning: unused variable
'c_hints'
../../guile-2.0.1.154-f3977/libguile/net_db.c: At top level:
../../guile-2.0.1.154-f3977/libguile/net_db.c:680:1: error: 'EAI_BADFLAGS'
undeclared here (not in a function)
../../guile-2.0.1.154-f3977/libguile/net_db.c:680:1: error: bit-field
'_gl_verify_error_if_negative' width not an integer constant
../../guile-2.0.1.154-f3977/libguile/net_db.c: In function 'scm_gai_strerror':
../../guile-2.0.1.154-f3977/libguile/net_db.c:744:3: warning: implicit
declaration of function 'gai_strerror'
../../guile-2.0.1.154-f3977/libguile/net_db.c:744:3: warning: passing argument
1 of 'scm_from_locale_string' makes pointer from integer without a cast
../../guile-2.0.1.154-f3977/libguile/strings.h:134:13: note: expected 'const
char *' but argument is of type 'int'
--8<---------------cut here---------------end--------------->8---
Clearly the AI_ constants and ‘struct addrinfo’ aren’t defined by
<netdb.h>.
The relevant part of the ‘configure’ output is [0]:
--8<---------------cut here---------------start------------->8---
checking whether getaddrinfo is declared without a macro... no
checking whether freeaddrinfo is declared without a macro... no
checking whether gai_strerror is declared without a macro... no
checking whether getnameinfo is declared without a macro... no
[...]
configure: checking how to do getaddrinfo, freeaddrinfo and getnameinfo
checking for library containing getaddrinfo... no
checking for getaddrinfo... no
checking for getaddrinfo in ws2tcpip.h and -lws2_32... no
checking whether gai_strerror is declared... yes
checking whether gai_strerrorA is declared... yes
checking for gai_strerror with POSIX signature... no
checking for struct sockaddr.sa_len... no
checking whether getaddrinfo is declared... no
checking whether freeaddrinfo is declared... no
checking whether getnameinfo is declared... no
checking for struct addrinfo... yes
--8<---------------cut here---------------end--------------->8---
‘struct addrinfo’ is found in <ws2tcpip.h>, so netdb.h should include it
when its available, I guess.
As for the AI_ and EAI_ constants, I don’t understand why they’re not
being defined [1].
Ideas?
Thanks,
Ludo’.
[0] http://hydra.nixos.org/build/1140382/log/raw
[1] See the generated files at:
http://hydra.nixos.org/build/1140382/download/1/nix-build-lcd1hjcnfv28rmiwn829wiwhaxdyybc3-guile-2.0.1.154-f3977-i686-pc-mingw32.drv-0/build/config.log
http://hydra.nixos.org/build/1140382/download/1/nix-build-lcd1hjcnfv28rmiwn829wiwhaxdyybc3-guile-2.0.1.154-f3977-i686-pc-mingw32.drv-0/build/lib/netdb.h
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- getaddrinfo on MinGW,
Ludovic Courtès <=