I tried to compile your example.cc using the latest lmdb++.h in /usr/include like so:
g++ example.cc
But I get the followin error:
/tmp/ccUhugbK.o: In function `lmdb::env_create(MDB_env**)':
example.cc:(.text+0x14): undefined reference to `mdb_env_create'
/tmp/ccUhugbK.o: In function `lmdb::env_open(MDB_env*, char const*, unsigned int, unsigned int)':
example.cc:(.text+0x5b): undefined reference to `mdb_env_open'
/tmp/ccUhugbK.o: In function `lmdb::env_close(MDB_env*)':
example.cc:(.text+0x8e): undefined reference to `mdb_env_close'
/tmp/ccUhugbK.o: In function `lmdb::env_set_flags(MDB_env*, unsigned int, bool)':
example.cc:(.text+0xc8): undefined reference to `mdb_env_set_flags'
/tmp/ccUhugbK.o: In function `lmdb::env_set_mapsize(MDB_env*, unsigned long)':
example.cc:(.text+0x106): undefined reference to `mdb_env_set_mapsize'
/tmp/ccUhugbK.o: In function `lmdb::txn_begin(MDB_env*, MDB_txn*, unsigned int, MDB_txn**)':
example.cc:(.text+0x14f): undefined reference to `mdb_txn_begin'
/tmp/ccUhugbK.o: In function `lmdb::txn_commit(MDB_txn*)':
example.cc:(.text+0x182): undefined reference to `mdb_txn_commit'
/tmp/ccUhugbK.o: In function `lmdb::txn_abort(MDB_txn*)':
example.cc:(.text+0x1b5): undefined reference to `mdb_txn_abort'
/tmp/ccUhugbK.o: In function `lmdb::dbi_open(MDB_txn*, char const*, unsigned int, unsigned int*)':
example.cc:(.text+0x1e6): undefined reference to `mdb_dbi_open'
/tmp/ccUhugbK.o: In function `lmdb::dbi_put(MDB_txn*, unsigned int, MDB_val const*, MDB_val*, unsigned int)':
example.cc:(.text+0x239): undefined reference to `mdb_put'
/tmp/ccUhugbK.o: In function `lmdb::cursor_open(MDB_txn*, unsigned int, MDB_cursor**)':
example.cc:(.text+0x28b): undefined reference to `mdb_cursor_open'
/tmp/ccUhugbK.o: In function `lmdb::cursor_close(MDB_cursor*)':
example.cc:(.text+0x2be): undefined reference to `mdb_cursor_close'
/tmp/ccUhugbK.o: In function `lmdb::cursor_get(MDB_cursor*, MDB_val*, MDB_val*, MDB_cursor_op)':
example.cc:(.text+0x2ef): undefined reference to `mdb_cursor_get'
/tmp/ccUhugbK.o: In function `lmdb::error::what() const':
example.cc:(.text._ZNK4lmdb5error4whatEv[_ZNK4lmdb5error4whatEv]+0x1c): undefined reference to `mdb_strerror'
collect2: error: ld returned 1 exit status
Looking inside lmdb++.h it seems that mdb_env_create hasn't been defined anywhere, but it IS referenced.
PS: Thanks for this great library, I hope to make use of it.
I tried to compile your example.cc using the latest
lmdb++.h
in/usr/include
like so:But I get the followin error:
Looking inside
lmdb++.h
it seems thatmdb_env_create
hasn't been defined anywhere, but it IS referenced.PS: Thanks for this great library, I hope to make use of it.