You need to tell the linker to link to the leveldb
library such as
g++ -I include/ testLevelDB.cpp -lleveldb
But this won't work if the library is not in /usr/lib
or /usr/local/lib
for that case assuming the libleveldb.so exists in some path called $LEVELDB_PATH
you need to do
g++ -I include -L $LEVELDB_PATH testLevelDB.cpp -lleveldb
-L
is much like -I
but it tells the linker where to looks for libraries.
Also since you seem to be new to gcc world, please have a look at this gcc intro document.