Berkeley db library 5.2 Setup

Build in Ubuntu :

1. Download the library from Oracle: http://www.oracle.com/technetwork/database/berkeleydb/downloads/index.html

2. Install it according to the document:

change to the build_unix directory :

../dist/configure

make

make install

3. Set up the environment variable:

export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.5.2/lib/:$LD_LIBRARY_PATH$

check the result:

XXXX@ubuntu:~/workspace/dbtest$ echo  $LD_LIBRARY_PATH$

(result:)                        /usr/local/BerkeleyDB.5.2/lib/:$$

4. Compile the program and run :

gcc -c -I/usr/local/BerkeleyDB.5.2/include/ dbtest.c
gcc -o db dbtest.o -L/usr/local/BerkeleyDB.5.2/lib/ -ldb
./db
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s