[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /usr/bin/ld: cannot find -lndbm



Lo, on Tuesday, February 12, Erik van der Meulen did write:

> On Tue, Feb 12, 2002 at 13:36:46 -0600, Jordan Evatt wrote:
> 
> > A quick search using apt on #debian gave me this: (/usr/include/db1/ndbm.h)
> > in devel/libc6-dev
> > Maybe you don't have libc6-dev installed? Check for that first. I have no
> > way of knowing if you have it installed or not.
> 
> Thanks for that. I do have libc6-dev installed and (consequently, I
> think) I have a /usr/include/db1/ndbm.h. But this does not seem enough.

The linker's looking for `libndbm.so', not ndbm.h.  However, on my
potato system, /usr/lib/libndbm.so is in libc6-dev along with the .h
file (as one would expect).

(All packages are as of potato; things may have moved since.)

Couple of things to check:

   1) libndbm.so should be a symlink; make sure that there's a real file
      at the end of the symlink chain.

   2) Make sure the file is really a shared library:
        `readelf -h /usr/lib/libndbm.so'
      If it prints out
        readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
      then the file got crunched; make sure your libc6 install is still
      valid.

   3) Where is the compiler/linker looking for the libraries?
      Cut-n-paste the compiler invocation that is printed when you do a
      `make' -- the bit that reads

        cc -Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include -O2  spamd/spamc.c \
        -o spamd/spamc -L/usr/local/lib -lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt

      into a terminal, stick a `-v' after the cc, run it, and post the
      output.  (There will likely be a fair amount, not all of which
      will necessarily make sense.)

That should give us a better idea of the problem.

Richard



Reply to: