Help linking to resolv using ns_name_uncompress

Peter Theobald petertheobald at
Wed Oct 23 21:37:29 UTC 2002

I hope someone can help me. I have a short simple C
program that looks up MX records.
I cannot compile it (actually link it), because I get
the following error:

gcc -o dnsmain dnsmain.o getmxrecords.o -lresolv
Undefined               first referenced
 symbol                     in file
__ns_name_uncompress        getmxrecords.o
ld: fatal: Symbol referencing errors. No ouput written
to dnsmain

I am linking to -lresolv, and I also tried specifying
I checked that the function I am calling is defined:
nm /usr/lib/ | grep __ns_name_uncompress
[119]  |  87980|    84|FUNC |0   |9  

So it *IS* there in libresolv... why can't ld find
this function?!

Thanks in advance for any light that can be shed on

Peter Theobald / Turtle Cove Technology, Inc.
Peter at

Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

More information about the bind-users mailing list