Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running example code throws "Undefined symbols for architecture x86_64" #13

Open
AKushWarrior opened this issue May 30, 2020 · 1 comment

Comments

@AKushWarrior
Copy link

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
Copy link
Author

AKushWarrior commented May 30, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant