Problem compiling example in the book

Kevin Darcy kcd at daimlerchrysler.com
Sat Apr 13 02:50:02 UTC 2002


At the very least, you'll probably need to link with the resolver library
("-lresolv" on the link line). Since this is Solaris, you might also need
-lnsl and maybe -lsocket too.

BTW, why are you putting an ".exe" extension on your executable? That's
your business, of course, but, just between you and me, it kinda brands
you as a greenhorn from WinTelLand...


- Kevin

John Heiden wrote:

> This isn't entirely a BIND issue, but recently I bought "the book" by
> Paul Albitz and Cricket Liu.  (Very good book, by the way.)
>
> Anyway, I am trying to compile the example in the book, and I am
> unable to.  I am trying to compile with GCC 3.0 under SPARC
> Solaris 7.  Here's what I get:
>
> checksoa.c: In function `queryNameServers':
> checksoa.c:435: warning: passing arg 1 of `ns_name_skip' from
> incompatible pointer type
> checksoa.c:436: warning: passing arg 1 of `ns_name_skip' from
> incompatible pointer type
> Undefined                       first referenced
>  symbol                             in file
> gethostbyname                       /var/tmp/cckFrApA.o
> _res                                /var/tmp/cckFrApA.o
> res_mkquery                         /var/tmp/cckFrApA.o
> h_errno                             /var/tmp/cckFrApA.o
> __ns_parserr                        /var/tmp/cckFrApA.o
> __ns_initparse                      /var/tmp/cckFrApA.o
> __ns_get32                          /var/tmp/cckFrApA.o
> res_send                            /var/tmp/cckFrApA.o
> res_init                            /var/tmp/cckFrApA.o
> __ns_name_uncompress                /var/tmp/cckFrApA.o
> _ns_flagdata                        /var/tmp/cckFrApA.o
> ns_name_skip                        /var/tmp/cckFrApA.o
> res_query                           /var/tmp/cckFrApA.o
> QueryNameServers                    /var/tmp/cckFrApA.o
> ld: fatal: Symbol referencing errors. No output written to checksoa.exe
> collect2: ld returned 1 exit status
>
> I have tried to compile two different ways (same results):
>
> gcc -I/usr/include -o checksoa.exe checksoa.c
> gcc -o checksoa.exe checksoa.c
>
> I have to say, I don't have as much experience with gcc as I would
> like.
>
> Is there a place I could just download the code from?  After typing for
> quite a while, I found I made 3 typos.  Is it possible I overlooked
> another
> typo?  Or is there maybe a typo in the book?
>
> Thank you much for your time on this.
>
> John Heiden
> Network Engineer
> The University of Toledo
> Toledo,  OH  43606
> jheiden2 at pop3.utoledo.edu



More information about the bind-users mailing list