perl build problems, chapter 5

Andrew Benton b3nton at
Sun Jul 3 03:26:03 PDT 2011

On Sat, 2 Jul 2011 19:26:34 -0700
Nathan Coulson <conathan at> wrote:

> Checking for optional libraries...
> What libraries to use?
> [-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat -lpthread]
> What optimizer/debugger flag should be used? [-O2]
> Any additional cc flags? [-fno-strict-aliasing -pipe -fstack-protector]
> Let me guess what the preprocessor flags are...
> Any additional ld flags (NOT including libraries)? [ -fstack-protector]
> Checking your choice of C compiler and flags for coherency...
> I've tried to compile and run the following simple program:
> #include <stdio.h>
> int main() { printf("Ok\n"); return(0); }
> I used the command:
> 	cc -o try -O2 -fno-strict-aliasing -pipe -fstack-protector
> -fstack-protector try.c -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
> -lgdbm_compat -lpthread
> 	 ./try
> and I got the following output:
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
> cannot find -lgdbm
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
> cannot find -ldb
> collect2: ld returned 1 exit status
> I can't compile the test program.
> You have a BIG problem.  Shall I abort Configure [y]
> Ok.  Stopping Configure.
> must have picked up that I had gdbm and db on the host somehow,
> My instructions worked fine until the last update (when we moved to
> make

How do you mean, "moved to make"? This error looks like it happens
during Configure, before we run make.


More information about the lfs-dev mailing list