首页 > 代码库 > slapadd: error while loading shared libraries: libdb-4.6.so: cannot open shared object file: No such file or directory

slapadd: error while loading shared libraries: libdb-4.6.so: cannot open shared object file: No such file or directory

# tar xvf db-4.7.25.tar.gz

# cd db_4.7.25

# cd build_unix/ 

# ../dist/configure -prefix=/home/XXX/app/BerkeleyDB

# make

# make install 


2、安装openldap前准备:配置环境变量,参考openldap install文件

#export CPPFLAGS="-I/home/XXX/app/BerkeleyDB/include -D_GNU_SOURCE"

注:不设置make时报getpeereid.c:65: error: storage size of ‘peercred’ isn’t known错误

#export LDFLAGS="-L/home/XXX/app/BerkeleyDB/lib"

注:不设置configure时报configure: error: BDB/HDB: BerkeleyDB not available错误

#export LD_LIBRARY_PATH="/home/XXX/download/db-4.7.25/build_unix/.libs"

注:不设置configure时报configure: error: Berkeley DB version mismatch错误


export LDFLAGS="-L/usr/local/BerkeleyDB.4.6/lib"

export LD_LIBRARY_PATH="/usr/local/db-4.6.21/build_unix/.libs"

export CPPFLAGS="-I/usr/local/BerkeleyDB.4.6/include -D_GNU_SOURCE"

slapadd: error while loading shared libraries: libdb-4.6.so: cannot open shared object file: No such file or directory