[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(usagi-users 02473) problem with getipnodebyuname
- To: usagi-users@xxxxxxxxxxxxxx
- Subject: (usagi-users 02473) problem with getipnodebyuname
- From: Leonardo Saavedra Henriquez <leo@xxxxxxxxxx>
- Date: Tue, 15 Jul 2003 19:30:20 -0400 (CLT)
- In-reply-to: <874r1o8354.fsf@zion.matrix>
- Reply-to: usagi-users@xxxxxxxxxxxxxx
Hi all
I have been working with IPv6 API, and I have a little problem with
getipnodebyname
when I try to compile this aplication it give me this error
leo@optimus:/home/leo/src$ gcc -Wall -O2 -o getipnodebyname
getipnodebyname.c
getipnodebyname.c: In function `main':
getipnodebyname.c:24: warning: implicit declaration of function
`getipnodebyname'
getipnodebyname.c:24: warning: assignment makes pointer from integer
without a cast
/tmp/cc8RVBvR.o(.text+0x50): In function `main':
: undefined reference to `getipnodebyname'
collect2: ld returned 1 exit status
--
The code resume is:
--
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
void usage(char *name)
{
fprintf(stderr, "usar %s <hostname> \n", name);
exit(0);
}
int main(int argc, char *argv[])
{
struct hostent *host;
int *errnum = 0;
char *nombre = argv[1];
if (argc != 2) {
usage(argv[0]);
}
host = getipnodebyname(nombre, AF_INET6, 0, errnum);
printf("nombre %s\n", host->h_name);
/* etc */
return 0;
}
--
if somebody can bring me a little ligth about the problem.
TIA
+----------------------------------------------+ ,''`.
| Leonardo Saavedra Henriquez |leo@xxxxxxxxxx | : :' :
| Est. Ing Civil en Informatica|U. del Bio-Bio | `. `'
+----------------------------------------------+ `-
[leo-> ~ $] cd pub && more beer