lmdb-safe
lmdb-safe copied to clipboard
Running example code throws "Undefined symbols for architecture x86_64"
I tried running the basic-example.cc code. I have the latest version of Boost (on my path and tested), and G++ 9 (also tested).
I will note, I'm not particularly familiar with C++. I'm using this project for FFI with another language.
Here is the terminal output:
❯ g++-9 basic-example.cc
Undefined symbols for architecture x86_64:
"getMDBEnv(char const*, int, int)", referenced from:
_main in ccQ1Ayh3.o
"MDBEnv::getROTransaction()", referenced from:
checkLMDB(MDBEnv*, MDBDbi) in ccQ1Ayh3.o
"MDBEnv::getRWTransaction()", referenced from:
_main in ccQ1Ayh3.o
"MDBEnv::openDB(boost::basic_string_ref<char, std::char_traits<char> >, int)", referenced from:
_main in ccQ1Ayh3.o
"_mdb_drop", referenced from:
_main in ccQ1Ayh3.o
"_mdb_get", referenced from:
MDBROTransactionImpl::get(unsigned int, MDBInVal const&, MDBOutVal&) in ccQ1Ayh3.o
MDBRWTransactionImpl::get(MDBDbi&, MDBInVal const&, MDBOutVal&) in ccQ1Ayh3.o
"_mdb_put", referenced from:
MDBRWTransactionImpl::put(unsigned int, MDBInVal const&, MDBInVal const&, int) in ccQ1Ayh3.o
"_mdb_strerror", referenced from:
MDBROTransactionImpl::get(unsigned int, MDBInVal const&, MDBOutVal&) in ccQ1Ayh3.o
MDBRWTransactionImpl::put(unsigned int, MDBInVal const&, MDBInVal const&, int) in ccQ1Ayh3.o
MDBRWTransactionImpl::get(MDBDbi&, MDBInVal const&, MDBOutVal&) in ccQ1Ayh3.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
I ran the code on a Mac. I fetched the code by git cloneing this repo.