LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2004, 04:38 AM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
why won't this compile


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

int main(){
char name[] = "aa.example.com.";
char domain[] = "192.168.0.25";
int class = 1;
int type = 1;
char answer[400];
int anslen;

res_querydomain(name, domain, class, type, answer, anslen);

printf("%s", answer);

}
=================================================
I type gcc my.c and error message come out. I checked "man resolver" thought I inculde everything

[root@localhost root]# gcc my.c
/tmp/ccZmTCxo.o(.text+0x72): In function `main':
: undefined reference to `__res_querydomain'
collect2: ld returned 1 exit status
 
Old 09-17-2004, 04:51 AM   #2
Sadrul
LQ Newbie
 
Registered: Mar 2004
Distribution: Slackware 10.0 (K: 2.4.26)
Posts: 13

Rep: Reputation: 0
Code:
gcc my.c -lresolv
-- Adil
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compile? icecream33 Programming 3 12-20-2017 11:49 AM
compile 2.6.13 jupiter3437 Linux - Software 3 09-09-2005 04:09 PM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM
Cannot compile c davidtsl Programming 8 12-13-2004 01:36 AM
Compile help Twiggy794 Linux - Software 1 12-03-2003 01:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration