This is a simple example to demonstrate how you use LevelDB with C.
Install LevelDB either by yourself or with a package manager. I recommend Homebrew for OS X. Please note that LevelDB requires Snappy.
build from source:
# git clone https://github.com/google/leveldb, follow readme build
cp --preserve=links libleveldb.a /usr/local/lib
cp -r include/leveldb /usr/local/include/
Compile with GCC:
gcc leveldb_example.c -Wall -lleveldb -lstdc++ -lpthread