> > On 10-Feb-99 Jon Bernard wrote:
> > > gcc -o dnsserver -g dnsserver.o -L../lib -lmiscutil -lm -lresolv -lnsl
> > > /lib/libresolv.a(res_send.o)(.text+0x80): undefined reference to
> > > `strerror'
>
> > I got that error on every Sun machine I tried it, both on SunOS and Solaris,
> > and I am not the only one here. It seems to be a peculiarity of those systems...
> >
> > (It seems the linker isn't able to find strerror.o in libmiscutil. I still
> > can't understand why, as I can see it using ar)
>
> Because the undefined reference came from libresolv.a, not from dnsserver.o,
> and -lresolv is _after_ -lmiscutil in the link line.
>
> And nor is it a bug in Sun ld - this is well defined behaviour for linkers.
>
> The problem is that his libresolv.a has a reference to strerror, when there
> is no strerror in libc. By looking on my Sunos 4 box here, the libresolv.a
> has no reference to strerror, so I suspect he got his resolver from some
> other place which made an assumption that strerror is on his system.
>
> He can fix this for the purposes of squid's dnsserver, but his resolver is
> still broken and he could stumble across this problem again when linking
> some other program with it.
It appears that something went wrong when I installed the resolver last
October. While the installed version of libresolv.a has a reference to
strerror, the original didn't. Following Jonathan's original suggestion
and modifying src/Makefile.in made it possible to link everything; now I
just have to fix the resolver problems.
Squid is working great, BTW.
Thanks to everyone for such speedy assistance.
Jon
Received on Thu Feb 11 1999 - 12:56:54 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:44:32 MST