Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 790 Bytes

README.md

File metadata and controls

27 lines (17 loc) · 790 Bytes

LevelDB C example

This is a simple example to demonstrate how you use LevelDB with C.

Install

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

Compile with GCC:

gcc leveldb_example.c -Wall -lleveldb -lstdc++ -lpthread

License

MIT