bug-glibc
[Top][All Lists]
Advanced

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

libc and it's resolver


From: Unixcontempler
Subject: libc and it's resolver
Date: Tue, 19 Jun 2001 10:58:44 +0200 (CEST)

Hi, I'm running Debian 2.2 (which means, libc6: 2.1.3-18 libc6-dev:
2.1.3-18)..

I'm having trouble getting the resolver to work...

this is the code:

#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

int main(void)
{
int ret;
char *tmp;

        tmp = malloc(512);

ret = res_init();
        if(ret == -1) {
        fprintf(stderr, "blah... res_init() failed\n");
        return 0;
        }

ret = res_query("194.236.112.59", 0, 0, tmp, 512);
        if(ret == -1) {
        fprintf(stderr, "Unable to do the thing...\n");
        return 0;
        }

printf("len: %d\nname: %s\n", ret, tmp);

return 1;
}

when I make (with gcc: 2.95.2-13)
I get:

address@hidden:~/test/dns$ make
gcc -Wall dns.c -o dns
/tmp/cctq0p0g.o: In function `main':
/tmp/cctq0p0g.o(.text+0x5b): undefined reference to `res_query'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Can someone help me out here?





reply via email to

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