Help linking to resolv using ns_name_uncompress

Mark_Andrews at isc.org Mark_Andrews at isc.org
Thu Oct 24 00:20:16 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
> -lsocket
> 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
> /usr/lib/libresolv.so
> I checked that the function I am calling is defined:
> nm /usr/lib/libresolv.so | grep __ns_name_uncompress
> [119]  |  87980|    84|FUNC |0   |9  
> |__ns_name_uncompress
> 
> So it *IS* there in libresolv... why can't ld find
> this function?!
> 
> 
> Thanks in advance for any light that can be shed on
> this...
> Peter

	You should be linking against libbind.

> 
> 
> =====
> Peter Theobald / Turtle Cove Technology, Inc.
> Peter at PeterTheobald.com
> 
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
> 
--
Mark Andrews, Internet Software Consortium
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark.Andrews at isc.org


More information about the bind-users mailing list