skade / leveldb-sys

MIT License
7 stars 15 forks source link

LInker errors on OS X when using this crate #5

Closed zaphar closed 7 years ago

zaphar commented 7 years ago

OSX 10.11.6 El Capitan

Clang version installed is:

$> clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Linker error is below:

  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
      _leveldb_open in libleveldb_sys-2b8436af3f829ffa.rlib(c.o)
      SaveError(char**, leveldb::Status const&) in libleveldb_sys-2b8436af3f829ffa.rlib(c.o)
      _leveldb_get in libleveldb_sys-2b8436af3f829ffa.rlib(c.o)
      leveldb::WriteBatch::WriteBatch() in libleveldb_sys-2b8436af3f829ffa.rlib(write_batch.o)
      leveldb::WriteBatch::~WriteBatch() in libleveldb_sys-2b8436af3f829ffa.rlib(write_batch.o)
      leveldb::SanitizeOptions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::InternalKeyComparator const*, leveldb::InternalFilterPolicy const*, leveldb::Options const&) in libleveldb_sys-2b8436af3f829ffa.rlib(db_impl.o)
      leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libleveldb_sys-2b8436af3f829ffa.rlib(db_impl.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This looks an awful lot like it's built with a different stdlib than the clang linker is using which is weird.

skade commented 7 years ago

Hi,

does this error occur with both 2.0.0 and 2.0.2? There was a fix for linking on OSX:

https://github.com/skade/leveldb-sys/pull/4

Best, Florian

zaphar commented 7 years ago

Did you mean 2.0.1? Yes that version now works. I somehow missed that bug when I was searching the issues, sorry for the duplication.