[comp.sys.mips] can't use private libresolv.a

gamiddle@maytag.waterloo.edu (Guy Middleton) (10/29/90)

When I try to compile the version of nslookup that comes with BIND 4.8.3, I
get this:

% make
cc -o nslookup main.o getinfo.o debug.o send.o skip.o list.o subr.o commands.o ../../res/libresolv.a -ll
ld:
/bsd43/usr/lib/libc.a(ht_getnamadr.o): _gethtent: multiply defined
/bsd43/usr/lib/libc.a(gethostnamadr.o): gethostbyname: multiply defined
/bsd43/usr/lib/libc.a(gethostnamadr.o): gethostbyaddr: multiply defined

It works fine if I don't use my own libresolv.

What's happening?  ld should not care what is in libc, if it already has what
it wants in libresolv.

I guessed it might have something to do with conflicting storage class, so I
made _gethtent() static, and that fixed the complaint.  What about the other
two?  They would not be very useful if static.

gamiddle@maytag.waterloo.edu (Guy Middleton) (10/30/90)

In article <1990Oct29.052543.9284@maytag.waterloo.edu> gamiddle@maytag.waterloo.edu (Guy Middleton) writes:
> What's happening?  ld should not care what is in libc, if it already has what
> it wants in libresolv.

I found the problem: nslookup uses getservbyname(), which is in
gethostnamadr.o in libc, but not in libresolv.

If library routines called themselves by secret internal names, this kind of
thing would not happen.