cURL / Mailing Lists / curl-users / Single Mail

curl-users

configure can't find gethostbyname on cygwin?

From: David Carter <david.carter_at_s1.com>
Date: Wed, 22 Aug 2001 16:35:14 -0400

./configure complains:
checking for gethostbyname... no
checking for gethostbyname in -lnsl... no
checking for gethostbyname... (cached) no
checking for gethostbyname in -lsocket... no
checking trying both nsl and socket libs... no
configure: error: couldn't find libraries for gethostbyname()
sed: can't read confdefs.h: No such file or directory

$ grep -r gethostbyname /usr/include/*.h
/usr/include/netdb.h: * Error return codes from gethostbyname() and
gethostbyadd
r()
/usr/include/netdb.h:struct hostent *gethostbyname (const char *);

Relevant(?) portions of config.log:

configure:7244: checking for gethostbyname
configure:7281: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:7250: confdefs.h: No such file or directory
configure:7284: $? = 1
configure: failed program was:
#line 7250 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostbyname (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply. */
char gethostbyname ();
char (*f) ();

int
main ()
{
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS. Some functions are actually named
    something starting with __ and the normal name is an alias. */
#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
f = gethostbyname;
#endif

  ;
  return 0;
}
configure:7300: result: no
configure:7306: checking for gethostbyname in -lnsl
configure:7333: gcc -o conftest.exe -g -O2 conftest.c -lnsl >&5
configure:7314: confdefs.h: No such file or directory
configure:7336: $? = 1
configure: failed program was:
#line 7314 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply. */
char gethostbyname ();
int
main ()
{
gethostbyname ();
  ;
  return 0;
}
configure:7353: result: no
configure:7367: checking for gethostbyname
configure:7423: result: no
configure:7429: checking for gethostbyname in -lsocket
configure:7456: gcc -o conftest.exe -g -O2 conftest.c -lsocket >&5
configure:7437: confdefs.h: No such file or directory
configure:7459: $? = 1
configure: failed program was:
#line 7437 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply. */
char gethostbyname ();
int
main ()
{
gethostbyname ();
  ;
  return 0;
}
configure:7476: result: no
configure:7492: checking trying both nsl and socket libs
configure:7509: gcc -o conftest.exe -g -O2 conftest.c -lnsl -lsocket >&5
configure:7497: confdefs.h: No such file or directory
configure:7512: $? = 1
configure: failed program was:
#line 7497 "configure"
#include "confdefs.h"

int
main ()
{
gethostbyname();
  ;
  return 0;
}
configure:7529: result: no
configure:7531: error: couldn't find libraries for gethostbyname()

## ----------------- ##
## Cache variables. ##
## ----------------- ##
<<<< snip >>>>

Thanks for any help you can provide.

David Carter
david at carter.net
david.carter at s1.com
Received on 2001-08-22