[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trouble with autotools/berkeley db
From: |
Karl Berry |
Subject: |
Re: trouble with autotools/berkeley db |
Date: |
Tue, 15 Feb 2005 17:10:50 -0500 |
I am able to compile the following bdb-dependent file, which I would
think is a sign that I have bdb installed:
Does it run? (Not just compile.)
checking for db_create in -ldb... no
configure: error: Berkeley db library not found
Anyone have any idea what's the matter?
Search in config.log for db_create; you should see the exact C program
Autoconf is testing with, the compiler invocation, and the errors.
If your db library is in /usr/lib or /lib, this won't apply, but I'll
vent anyway: My experience is that autoconf not finding libraries is
often because of shared libraries. That is, the program has to be
linked with -R/your/library/dir. This is true even for libstdc++,
libgcc_s, and the like. I have never understood why GCC does not
automatically -R those directories. (I reported it, but they rejected
the suggestion.) The result is that if you compile a hello,world C++
program, it will not run if the libstdc++ used is not in a system
directory.
In the latest gcc, they made it even harder by (apparently) removing -R
as an option to the compiler. To configure subversion, for example, I
had to resort to this:
configure \
--with-berkeley-db=/usr/local/db \
LDFLAGS="-Wl,-R -Wl,/usr/local/db/lib -Wl,-R -Wl,/usr/local/gnu/lib -Wl,-R
-Wl,/usr/local/lib" \
Sigh.
Happy linking,
karl