OpenLDAP on Ubuntu

Well, it’s been a real pain…

Trying to install OpenLDAP onto Ubuntu (yep, I have made the switch recently after getting highly frustrated by Mandriva), I kept getting this error:

/usr/lib/libsasl2.a(db_berkeley.o)(.text+0x5a): In function `berkeleydb_open':
: undefined reference to `db_create_4002'
/usr/lib/libsasl2.a(db_berkeley.o)(.text+0x85): In function `berkeleydb_open':
: undefined reference to `db_strerror_4002'

even with BDB 4.2. I tried a lot of things (installing BDB 4.4, for instance, but that wasn’t of much help). I reckon the problem was with the libsasl library installed…

So I proceeded to install the latest version of Cyrus SASL
Whilst compiling it, I was getting yet another error:

saslint.h:112: error: previous declaration of 'global_callbacks' was here

A bit annoyed, I googled the error, and came across this page which was recommending to comment out the line mentioned in the error message. Compiled the whole thing again—this time with success.

Once this was done, I tried to compile OpenLDAP again, this time with the following command:

env LDFLAGS="-I/usr/local/lib -I/usr/local/lib/sasl2/" ./configure 
--enable-bdb --enable-aci --enable-crypt

so that the compiler fetches the right SASL libraries.

And after much struggled, it worked! Long sigh of relief.

Update: Forgot to mention. You may need to link the libsasl libraries in /usr/lib to the ones you have installed to make sure OpenLDAP picks up the right ones when starting.


Commenting is closed for this article.