bug-gnulib
[Top][All Lists]
Advanced

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

Re: module gethostname


From: Sam Steingold
Subject: Re: module gethostname
Date: Thu, 16 Sep 2010 15:45:28 -0400
User-agent: Thunderbird 2.0.0.24 (X11/20100721)

Bruno Haible wrote:
I am now getting

undefined reference to `_gethostname_used_without_requesting_gnulib_module_gethostname'

This indicates that you have included gnulib <unistd.h>, are using 
gethostname(),
and have not asked for the gnulib module 'gethostname'.
  - If you want to use a POSIX compliant gethostname() function, you need to
    request the 'gethostname' module.
  - If you want to use Win32 gethostname() - handling errors in the Win32 way,
    and guaranteeing the socket library initialization call yourself - then be
    sure to #include <unistd.h>, then #undef gethostname, and then #include
    <winsock2.h> and <ws2tcpip.h>.

thanks.
now I get a linking error:

Warning: resolving _gethostname by linking to address@hidden
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
libgnu_cl.a(sockets.o): In function `close_fd_maybe_socket':
/cygdrive/c/sds/dev/current/build-mingw-O-2/gllib/../../src/gllib/sockets.c:44:
undefined reference to address@hidden'
collect2: ld returned 1 exit status

curiously, this happens only when I link the base linking set; the boot linking set is created just fine




reply via email to

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