Unix安装BerkeleyDB

  1. 下载安装包Berkeley DB 5.3.21.tar.ghttp://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html
  2. 解压 tar -zxvf Berkeley DB 5.3.21.tar.gz
  3. cd Berkeley DB 5.3.21/build_unix
  4. Build Berkeley DB 库:
    1. ../dist/configure /*如果用Berkeley DB C++ API, 要加--enable-cxx选项*/
    2. make  
  5. 安装Berkeley DB库: make install

  P.S.

  1.   如果要重新生成Berkeley DB库:

  make clean

  make

  2. 如果要改变配置(configure):

  make realclean

  ../dist/congiure

  make

  3. 如果要卸载Berkeley DB: make uninstall

  我刚开始安装Berkeley DB 时,../dist/configure 后面没有加--enable-cxx 选项, 后面编译用到Berkeley DB API的C++程序时,出现如果错误:“<iostream.h> is undefined” "<exception.h> is undefined"。 后面看了一些帖子,发现--enable-cxx这个选项,在configure的时候加上--enable-cxx选项重新生成安装Berkeley DB。再编译C++程序就没有错误了。其实,Berkeley DB的document里有对configuration的详细介绍http://docs.oracle.com/cd/E17076_03/html/installation/build_unix_conf.html 。--enable-cxx 是用来build Berkeley DB C++ API。类似的,--enable-java用来build Berkeley DB Java API。

 

posted on 2013-08-16 01:22  Ryan-Xing  阅读(666)  评论(0编辑  收藏  举报