On 23-Dec-00 at 08:41, GOMBAS Gabor ([EMAIL PROTECTED]) wrote:
> On Fri, Dec 22, 2000 at 11:26:42PM -0800, [EMAIL PROTECTED] wrote:
>
> > > /usr/local/lib/libucdmibs.so: undefined reference to `auto_nlist_value'
> > > /usr/local/lib/libucdmibs.so: undefined reference to `kvm_getswapinfo'
> > > /usr/local/lib/libucdmibs.so: undefined reference to `auto_nlist'
> > > /usr/local/lib/libucdagent.so: undefined reference to `kvm_geterr'
> > > /usr/local/lib/libucdagent.so: undefined reference to `kvm_read'
> > > /usr/local/lib/libucdagent.so: undefined reference to `kvm_openfiles'
> > > *** Error code 1
> >
> > find /usr/include -name '*.h' -print | xargs grep kvm_getswapinfo
> > shows it in <kvm.h>. The rest of the kvm items are probably also
> > in there. My first guess would be a missing system-specific include.
>
> You are completely missing the point. It's a linker error, so it has
> absolutely _nothing_ to do with headers. You have to find out which
> library contains the kvm_* functions and add it to the command line.
> I do not know FreeBSD but on Solaris you would need to add "-lkvm"...
Argh. Yep, you're right - I shouldn't try to answer technical
questions when I'm that tired.
The grep was still a good starting point because it indicates that
the kvm_* entities should be coming from a system library. So the
next step is:
nm --print-file-name /usr/lib/lib*.so /usr/lib/lib*.a \
2>/dev/null | grep '[Td] kvm_'
This shows that they are in, unsurprisingly, libkvm.a and libkvm_p.a.
So the link for FreeBSD is missing '-lkvm'. (Or, possibly, has it
too early in the list.)
I still don't know where auto_nlist is supposed to be coming from.
Grepping through the source and examining the code around references
might give a clue based on what it appears to be doing.
-Pat