[Top][All Lists]

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

Network-related functions and configuring for MinGW

From: Eli Zaretskii
Subject: Network-related functions and configuring for MinGW
Date: Sat, 07 Jan 2012 16:38:56 +0200

[Please CC me on the responses, as I'm not subscribed to the list.]

Configuring several packages for building on MS-Windows with MinGW, I
bumped several times into a situation where the configure script
reports the lack of network-related functions such as gethostbyname,
getdomainname, and others.  The build then at best produces warnings
(due to missing or incompatible declarations) or even errors.

This happens because the configure script assumes the prototypes of
these functions are in certain headers, but winsock2.h on Windows is
not included in the list of those headers.  And that's where those
prototypes are found on Windows.  However, the only Windows-specific
header searched by configure is io.h.

There's another group of network-related functions that needs
_WIN32_WINNT to be defined to 0x0501, otherwise the prototypes will
not be seen by the compiler.  This group of functions includes
getaddrinfo, getnameinfo, and freeaddrinfo.  Because the configure
script does not define this macro in the test programs it runs, it
incorrectly concludes that these functions are missing, which leads to
warnings and errors during the build.

Is it possible to update the Autoconf tests so as to eliminate these


reply via email to

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