lmdb-safe icon indicating copy to clipboard operation
lmdb-safe copied to clipboard

Running example code throws "Undefined symbols for architecture x86_64"

Open AKushWarrior opened this issue 5 years ago • 1 comments

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

AKushWarrior avatar May 30 '20 04:05 AKushWarrior

I ran the code on a Mac. I fetched the code by git cloneing this repo.

AKushWarrior avatar May 30 '20 04:05 AKushWarrior