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

gethostbyname2 / getipnodebyname



I'm using Debian woody (last updated probly a month or so ago). I'm trying
to use gethostbyname2 or getipnodebyname, but despite the fact that they
are mentioned in the man pages and the netdb.h header file, which I am
including, g++ is claiming they are undeclared. Neither does it work
if I explicitly include an appropriate extern declaration in my source.

Any ideas? Am I just being stupid?


$ cat test.cpp
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>


int main(void)
{
  struct hostent *foo;

  foo = gethostbyname2("localhost-ip6",AF_INET6);
}

$ g++ -Wall -ansi -pedantic test.cpp
test.cpp: In function `int main()':
test.cpp:9: `gethostbyname2' undeclared (first use this function)
test.cpp:9: (Each undeclared identifier is reported only once
test.cpp:9: for each function it appears in.)
$


Cheers.


-- 
"While you're technically correct, you are quite wrong" - John Levon
	                                   jason@khendon.org.uk


-- 
To UNSUBSCRIBE, email to debian-ipv6-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: