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
                                           [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


Reply via email to