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

Std C++ levelDB linker error when linking against 6.14-6.16. #4819

Closed
possen opened this issue Feb 4, 2020 · 20 comments · Fixed by #4895
Closed

Std C++ levelDB linker error when linking against 6.14-6.16. #4819

possen opened this issue Feb 4, 2020 · 20 comments · Fixed by #4895
Assignees
Labels
api: database Carthage zip-builder Tools related to building the zip file.
Milestone

Comments

@possen
Copy link

possen commented Feb 4, 2020

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 11.3.1
  • Firebase SDK version: 6.14 - 6.16
  • Firebase Component: LevelDB
  • Component version: 6.14 - 6.16
  • Installation method: Carthage

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

When I try to link my library with versions after 6.13 I am getting an error saying it cant find std library symbols when linking the levelDB library. I get this error when I try to link my library to the Firebase SDK. The carthage update command succeeds without error, this is only after linking to my library.

Showing All Messages
Ld /Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Products/Debug-iphonesimulator/SharedCore.framework/SharedCore normal x86_64 (in target 'SharedCore' from project 'Cores')
    cd /Users/possen/Projects/RideCore
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios12.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -L/Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Products/Debug-iphonesimulator -F/Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Products/Debug-iphonesimulator -F/Users/possen/Projects/Core/Carthage/Build/iOS -filelist /Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Intermediates.noindex/Cores.build/Debug-iphonesimulator/SharedCore.build/Objects-normal/x86_64/SharedCore.LinkFileList -install_name @executable_path/../Frameworks/SharedCore.framework/SharedCore -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Intermediates.noindex/Cores.build/Debug-iphonesimulator/SharedCore.build/Objects-normal/x86_64/SharedCore_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Intermediates.noindex/Cores.build/Debug-iphonesimulator/SharedCore.build/Objects-normal/x86_64/SharedCore.swiftmodule -ObjC -framework GoogleUtilities -framework FirebaseCore -framework nanopb -framework GTMSessionFetcher -framework FirebaseMessaging -framework FirebaseInstanceID -framework leveldb-library -framework FirebaseAuth -framework FirebaseMessaging -framework FirebaseAnalytics -framework Firebase -framework GoogleAppMeasurement -framework FirebaseDatabase -framework Protobuf -compatibility_version 1 -current_version 9 -Xlinker -dependency_info -Xlinker /Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Intermediates.noindex/Cores.build/Debug-iphonesimulator/SharedCore.build/Objects-normal/x86_64/SharedCore_dependency_info.dat -o /Users/possen/Library/Developer/Xcode/DerivedData/Cores-esachfxxvohxazcdpfwszjvpzqni/Build/Products/Debug-iphonesimulator/SharedCore.framework/SharedCore

Undefined symbols for architecture x86_64:
  "typeinfo for std::__1::ios_base", referenced from:
      typeinfo for std::__1::basic_ios<char, std::__1::char_traits<char> > in leveldb-library(env_posix.o)
  "std::uncaught_exception()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry() in leveldb-library(env_posix.o)
  "std::__1::ios_base::clear(unsigned int)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush() in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry() in leveldb-library(env_posix.o)
  "std::__1::locale::~locale()", referenced from:
      leveldb::PosixLogger::Logv(char const*, __va_list_tag*) in leveldb-library(env_posix.o)
      std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in leveldb-library(env_posix.o)
      std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in leveldb-library(env_posix.o)
      virtual thunk to std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in leveldb-library(env_posix.o)
      virtual thunk to std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in leveldb-library(env_posix.o)
      std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_stringbuf() in leveldb-library(env_posix.o)
      std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_stringbuf() in leveldb-library(env_posix.o)
      ...
  "std::__1::locale::locale()", referenced from:
      leveldb::PosixLogger::Logv(char const*, __va_list_tag*) in leveldb-library(env_posix.o)
  "std::__1::ios_base::~ios_base()", referenced from:
      leveldb::PosixLogger::Logv(char const*, __va_list_tag*) in leveldb-library(env_posix.o)
      std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream() in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream() in leveldb-library(env_posix.o)
      virtual thunk to std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream() in leveldb-library(env_posix.o)
      virtual thunk to std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream() in leveldb-library(env_posix.o)
      std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_ostringstream() in leveldb-library(env_posix.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
      leveldb::(anonymous namespace)::PosixWritableFile::PosixWritableFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int) in leveldb-library(env_posix.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
      leveldb::WriteBatchInternal::Append(leveldb::WriteBatch*, leveldb::WriteBatch const*) in leveldb-library(write_batch.o)
      leveldb::DBImpl::DeleteObsoleteFiles() in leveldb-library(db_impl.o)
      leveldb::DestroyDB(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::Options const&) in leveldb-library(db_impl.o)
      leveldb::Status::ToString() const in leveldb-library(status.o)
      leveldb::Version::DebugString() const in leveldb-library(version_set.o)
      leveldb::VersionSet::Recover(bool*) in leveldb-library(version_set.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in leveldb-library(version_set.o)
      ...
  "std::__1::__thread_struct::__thread_struct()", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::Schedule(void (*)(void*), void*) in leveldb-library(env_posix.o)
      std::__1::thread::thread<void (*&)(void*), void*&, void>(void (*&)(void*), void*&) in leveldb-library(env_posix.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::rfind(char, unsigned long) const", referenced from:
      leveldb::(anonymous namespace)::PosixWritableFile::PosixWritableFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int) in leveldb-library(env_posix.o)
  "std::__1::__throw_system_error(int, char const*)", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::Schedule(void (*)(void*), void*) in leveldb-library(env_posix.o)
      std::__1::thread::thread<void (*&)(void*), void*&, void>(void (*&)(void*), void*&) in leveldb-library(env_posix.o)
  "std::__1::thread::~thread()", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::Schedule(void (*)(void*), void*) in leveldb-library(env_posix.o)
      leveldb::(anonymous namespace)::PosixEnv::StartThread(void (*)(void*), void*) in leveldb-library(env_posix.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) in leveldb-library(db_impl.o)
      leveldb::DBImpl::BackgroundCompaction() in leveldb-library(db_impl.o)
      leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) in leveldb-library(version_set.o)
      leveldb::VersionSet::GetRange(std::__1::vector<leveldb::FileMetaData*, std::__1::allocator<leveldb::FileMetaData*> > const&, leveldb::InternalKey*, leveldb::InternalKey*) in leveldb-library(version_set.o)
      leveldb::VersionSet::SetupOtherInputs(leveldb::Compaction*) in leveldb-library(version_set.o)
      leveldb::FindLargestKey(leveldb::InternalKeyComparator const&, std::__1::vector<leveldb::FileMetaData*, std::__1::allocator<leveldb::FileMetaData*> > const&, leveldb::InternalKey*) in leveldb-library(version_set.o)
      leveldb::AddBoundaryInputs(leveldb::InternalKeyComparator const&, std::__1::vector<leveldb::FileMetaData*, std::__1::allocator<leveldb::FileMetaData*> > const&, std::__1::vector<leveldb::FileMetaData*, std::__1::allocator<leveldb::FileMetaData*> >*) in leveldb-library(version_set.o)
      ...
  "___cxa_guard_abort", referenced from:
      leveldb::Env::Default() in leveldb-library(env_posix.o)
  "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush() in leveldb-library(env_posix.o)
  "___cxa_guard_acquire", referenced from:
      leveldb::BytewiseComparator() in leveldb-library(comparator.o)
      leveldb::Env::Default() in leveldb-library(env_posix.o)
      leveldb::crc32c::Extend(unsigned int, char const*, unsigned long) in leveldb-library(crc32c.o)
  "std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)", referenced from:
      leveldb::DBImpl::~DBImpl() in leveldb-library(db_impl.o)
      leveldb::DBImpl::TEST_CompactMemTable() in leveldb-library(db_impl.o)
      leveldb::DBImpl::TEST_CompactRange(int, leveldb::Slice const*, leveldb::Slice const*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::Write(leveldb::WriteOptions const&, leveldb::WriteBatch*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::MakeRoomForWrite(bool) in leveldb-library(db_impl.o)
      leveldb::(anonymous namespace)::PosixEnv::BackgroundThreadMain() in leveldb-library(env_posix.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
      leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&) in leveldb-library(write_batch.o)
      leveldb::WriteBatch::Delete(leveldb::Slice const&) in leveldb-library(write_batch.o)
      leveldb::Version::DebugString() const in leveldb-library(version_set.o)
      leveldb::AppendEscapedStringTo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, leveldb::Slice const&) in leveldb-library(logging.o)
      std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int) in leveldb-library(env_posix.o)
      leveldb::FilterBlockBuilder::Finish() in leveldb-library(filter_block.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const", referenced from:
      leveldb::VersionSet::Recover(bool*) in leveldb-library(version_set.o)
  "typeinfo for std::length_error", referenced from:
      std::__1::__throw_length_error(char const*) in leveldb-library(db_impl.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_set.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_edit.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(env_posix.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(block_builder.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(filter_block.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(arena.o)
      ...
  "std::__1::ios_base::getloc() const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
  "std::length_error::~length_error()", referenced from:
      std::__1::__throw_length_error(char const*) in leveldb-library(db_impl.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_set.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_edit.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(env_posix.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(block_builder.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(filter_block.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(arena.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::LockFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::FileLock**) in leveldb-library(env_posix.o)
      leveldb::(anonymous namespace)::PosixEnv::UnlockFile(leveldb::FileLock*) in leveldb-library(env_posix.o)
  "___cxa_throw", referenced from:
      std::__1::__throw_length_error(char const*) in leveldb-library(db_impl.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_set.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_edit.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(env_posix.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(block_builder.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(filter_block.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(arena.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
      leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in leveldb-library(db_impl.o)
      leveldb::Version::DebugString() const in leveldb-library(version_set.o)
      leveldb::SetCurrentFile(leveldb::Env*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long) in leveldb-library(filename.o)
      leveldb::VersionEdit::DebugString() const in leveldb-library(version_edit.o)
      leveldb::TableBuilder::Finish() in leveldb-library(table_builder.o)
      leveldb::ParsedInternalKey::DebugString() const in leveldb-library(dbformat.o)
      leveldb::AppendNumberTo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, unsigned long long) in leveldb-library(logging.o)
      ...
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:
      typeinfo for leveldb::(anonymous namespace)::MemTableInserter in leveldb-library(write_batch.o)
      typeinfo for leveldb::DBImpl in leveldb-library(db_impl.o)
      typeinfo for leveldb::SnapshotImpl in leveldb-library(db_impl.o)
      typeinfo for leveldb::DBImpl::RecoverLogFile(unsigned long long, bool, bool*, leveldb::VersionEdit*, unsigned long long*)::LogReporter in leveldb-library(db_impl.o)
      typeinfo for leveldb::Version::LevelFileNumIterator in leveldb-library(version_set.o)
      typeinfo for leveldb::VersionSet::Recover(bool*)::LogReporter in leveldb-library(version_set.o)
      typeinfo for leveldb::(anonymous namespace)::BytewiseComparatorImpl in leveldb-library(comparator.o)
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
      leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in leveldb-library(db_impl.o)
      leveldb::InternalKey::DebugString() const in leveldb-library(dbformat.o)
      leveldb::(anonymous namespace)::PosixEnv::GetTestDirectory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in leveldb-library(env_posix.o)
  "operator new[](unsigned long)", referenced from:
      leveldb::Status::CopyState(char const*) in leveldb-library(status.o)
      leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&) in leveldb-library(status.o)
      leveldb::VersionSet::MakeInputIterator(leveldb::Compaction*) in leveldb-library(version_set.o)
      leveldb::(anonymous namespace)::HandleTable::Resize() in leveldb-library(cache.o)
      leveldb::LookupKey::LookupKey(leveldb::Slice const&, unsigned long long) in leveldb-library(dbformat.o)
      leveldb::NewMergingIterator(leveldb::Comparator const*, leveldb::Iterator**, int) in leveldb-library(merger.o)
      leveldb::PosixLogger::Logv(char const*, __va_list_tag*) in leveldb-library(env_posix.o)
      ...
  "std::__1::condition_variable::notify_one()", referenced from:
      leveldb::DBImpl::Write(leveldb::WriteOptions const&, leveldb::WriteBatch*) in leveldb-library(db_impl.o)
      leveldb::(anonymous namespace)::PosixEnv::Schedule(void (*)(void*), void*) in leveldb-library(env_posix.o)
  "___cxa_allocate_exception", referenced from:
      std::__1::__throw_length_error(char const*) in leveldb-library(db_impl.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_set.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_edit.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(env_posix.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(block_builder.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(filter_block.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(arena.o)
      ...
  "vtable for std::length_error", referenced from:
      std::length_error::length_error(char const*) in leveldb-library(db_impl.o)
      std::length_error::length_error(char const*) in leveldb-library(version_set.o)
      std::length_error::length_error(char const*) in leveldb-library(version_edit.o)
      std::length_error::length_error(char const*) in leveldb-library(env_posix.o)
      std::length_error::length_error(char const*) in leveldb-library(block_builder.o)
      std::length_error::length_error(char const*) in leveldb-library(filter_block.o)
      std::length_error::length_error(char const*) in leveldb-library(arena.o)
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "std::__1::condition_variable::notify_all()", referenced from:
      leveldb::DBImpl::RecordBackgroundError(leveldb::Status const&) in leveldb-library(db_impl.o)
      leveldb::DBImpl::BackgroundCall() in leveldb-library(db_impl.o)
      leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*) in leveldb-library(db_impl.o)
  "vtable for __cxxabiv1::__vmi_class_type_info", referenced from:
      typeinfo for std::__1::basic_ostream<char, std::__1::char_traits<char> > in leveldb-library(env_posix.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:
      leveldb::WriteBatch::Clear() in leveldb-library(write_batch.o)
      leveldb::VersionSet::Recover(bool*) in leveldb-library(version_set.o)
      leveldb::(anonymous namespace)::BytewiseComparatorImpl::FindShortestSeparator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, leveldb::Slice const&) const in leveldb-library(comparator.o)
      leveldb::(anonymous namespace)::BytewiseComparatorImpl::FindShortSuccessor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) const in leveldb-library(comparator.o)
      leveldb::PosixLogger::Logv(char const*, __va_list_tag*) in leveldb-library(env_posix.o)
      std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int) in leveldb-library(env_posix.o)
      leveldb::BlockBuilder::Add(leveldb::Slice const&, leveldb::Slice const&) in leveldb-library(block_builder.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long)", referenced from:
      leveldb::WriteBatchInternal::SetContents(leveldb::WriteBatch*, leveldb::Slice const&) in leveldb-library(write_batch.o)
      leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*) in leveldb-library(db_impl.o)
      leveldb::BuildTable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::Env*, leveldb::Options const&, leveldb::TableCache*, leveldb::Iterator*, leveldb::FileMetaData*) in leveldb-library(builder.o)
      leveldb::SaveValue(void*, leveldb::Slice const&, leveldb::Slice const&) in leveldb-library(version_set.o)
      leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*) in leveldb-library(version_set.o)
      leveldb::GetInternalKey(leveldb::Slice*, leveldb::InternalKey*) in leveldb-library(version_edit.o)
      leveldb::TableBuilder::Add(leveldb::Slice const&, leveldb::Slice const&) in leveldb-library(table_builder.o)
      ...
  "void std::__1::__sort<std::__1::__less<unsigned long long, unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, std::__1::__less<unsigned long long, unsigned long long>&)", referenced from:
      leveldb::DBImpl::Recover(leveldb::VersionEdit*, bool*) in leveldb-library(db_impl.o)
  "___cxa_end_catch", referenced from:
      std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int) in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush() in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry() in leveldb-library(env_posix.o)
  "std::__1::mutex::unlock()", referenced from:
      leveldb::DBImpl::~DBImpl() in leveldb-library(db_impl.o)
      leveldb::DBImpl::WriteLevel0Table(leveldb::MemTable*, leveldb::VersionEdit*, leveldb::Version*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::CompactRange(leveldb::Slice const*, leveldb::Slice const*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::TEST_CompactMemTable() in leveldb-library(db_impl.o)
      leveldb::DBImpl::TEST_CompactRange(int, leveldb::Slice const*, leveldb::Slice const*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::BackgroundCall() in leveldb-library(db_impl.o)
      leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*) in leveldb-library(db_impl.o)
      ...
  "std::__1::condition_variable::~condition_variable()", referenced from:
      leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in leveldb-library(db_impl.o)
      leveldb::port::CondVar::~CondVar() in leveldb-library(db_impl.o)
      leveldb::DBImpl::~DBImpl() in leveldb-library(db_impl.o)
      leveldb::DBImpl::Write(leveldb::WriteOptions const&, leveldb::WriteBatch*) in leveldb-library(db_impl.o)
      leveldb::port::CondVar::CondVar(leveldb::port::Mutex*) in leveldb-library(db_impl.o)
      leveldb::Env::Default() in leveldb-library(env_posix.o)
      leveldb::port::CondVar::~CondVar() in leveldb-library(env_posix.o)
      ...
  "std::__1::ctype<char>::id", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
      leveldb::DBImpl::~DBImpl() in leveldb-library(db_impl.o)
      leveldb::VersionSet::~VersionSet() (.cold.1) in leveldb-library(version_set.o)
      leveldb::VersionSet::Builder::SaveTo(leveldb::Version*) (.cold.1) in leveldb-library(version_set.o)
      leveldb::(anonymous namespace)::PosixSequentialFile::~PosixSequentialFile() in leveldb-library(env_posix.o)
      leveldb::(anonymous namespace)::PosixRandomAccessFile::~PosixRandomAccessFile() in leveldb-library(env_posix.o)
      leveldb::(anonymous namespace)::PosixMmapReadableFile::~PosixMmapReadableFile() in leveldb-library(env_posix.o)
      leveldb::(anonymous namespace)::PosixWritableFile::~PosixWritableFile() in leveldb-library(env_posix.o)
      ...
  "std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
  "std::terminate()", referenced from:
      ___clang_call_terminate in leveldb-library(db_impl.o)
  "std::__1::mutex::lock()", referenced from:
      leveldb::DBImpl::~DBImpl() in leveldb-library(db_impl.o)
      leveldb::DBImpl::WriteLevel0Table(leveldb::MemTable*, leveldb::VersionEdit*, leveldb::Version*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::CompactRange(leveldb::Slice const*, leveldb::Slice const*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::TEST_CompactMemTable() in leveldb-library(db_impl.o)
      leveldb::DBImpl::TEST_CompactRange(int, leveldb::Slice const*, leveldb::Slice const*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::BackgroundCall() in leveldb-library(db_impl.o)
      leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*) in leveldb-library(db_impl.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in leveldb-library(db_impl.o)
      leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) in leveldb-library(db_impl.o)
      void std::__1::allocator_traits<std::__1::allocator<leveldb::DBImpl::CompactionState::Output> >::construct<leveldb::DBImpl::CompactionState::Output, leveldb::DBImpl::CompactionState::Output const&>(std::__1::allocator<leveldb::DBImpl::CompactionState::Output>&, leveldb::DBImpl::CompactionState::Output*, leveldb::DBImpl::CompactionState::Output const&) in leveldb-library(db_impl.o)
      leveldb::VersionSet::VersionSet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::Options const*, leveldb::TableCache*, leveldb::InternalKeyComparator const*) in leveldb-library(version_set.o)
      leveldb::VersionSet::Builder::Apply(leveldb::VersionEdit*) in leveldb-library(version_set.o)
      leveldb::VersionEdit::SetCompactPointer(int, leveldb::InternalKey const&) in leveldb-library(version_set.o)
      leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) in leveldb-library(version_set.o)
      ...
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in leveldb-library(db_impl.o)
      std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int) in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*) in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush() in leveldb-library(env_posix.o)
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry() in leveldb-library(env_posix.o)
  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
      void std::__1::vector<std::__1::pair<int, leveldb::FileMetaData>, std::__1::allocator<std::__1::pair<int, leveldb::FileMetaData> > >::__push_back_slow_path<std::__1::pair<int, leveldb::FileMetaData> >(std::__1::pair<int, leveldb::FileMetaData>&&) in leveldb-library(db_impl.o)
      void std::__1::vector<unsigned long long, std::__1::allocator<unsigned long long> >::__push_back_slow_path<unsigned long long const&>(unsigned long long const&) in leveldb-library(db_impl.o)
      void std::__1::vector<leveldb::DBImpl::CompactionState::Output, std::__1::allocator<leveldb::DBImpl::CompactionState::Output> >::__push_back_slow_path<leveldb::DBImpl::CompactionState::Output const&>(leveldb::DBImpl::CompactionState::Output const&) in leveldb-library(db_impl.o)
      void std::__1::vector<leveldb::Iterator*, std::__1::allocator<leveldb::Iterator*> >::__push_back_slow_path<leveldb::Iterator*>(leveldb::Iterator*&&) in leveldb-library(db_impl.o)
      std::__1::enable_if<(__is_forward_iterator<std::__1::__wrap_iter<leveldb::FileMetaData* const*> >::value) && (is_constructible<leveldb::FileMetaData*, std::__1::iterator_traits<std::__1::__wrap_iter<leveldb::FileMetaData* const*> >::reference>::value), std::__1::__wrap_iter<leveldb::FileMetaData**> >::type std::__1::vector<leveldb::FileMetaData*, std::__1::allocator<leveldb::FileMetaData*> >::insert<std::__1::__wrap_iter<leveldb::FileMetaData* const*> >(std::__1::__wrap_iter<leveldb::FileMetaData* const*>, std::__1::__wrap_iter<leveldb::FileMetaData* const*>, std::__1::__wrap_iter<leveldb::FileMetaData* const*>) in leveldb-library(version_set.o)
      void std::__1::vector<std::__1::pair<int, leveldb::InternalKey>, std::__1::allocator<std::__1::pair<int, leveldb::InternalKey> > >::__push_back_slow_path<std::__1::pair<int, leveldb::InternalKey> >(std::__1::pair<int, leveldb::InternalKey>&&) in leveldb-library(version_set.o)
      void std::__1::vector<std::__1::pair<int, leveldb::FileMetaData>, std::__1::allocator<std::__1::pair<int, leveldb::FileMetaData> > >::__push_back_slow_path<std::__1::pair<int, leveldb::FileMetaData> >(std::__1::pair<int, leveldb::FileMetaData>&&) in leveldb-library(version_set.o)
      ...
  "std::__1::__thread_struct::~__thread_struct()", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::Schedule(void (*)(void*), void*) in leveldb-library(env_posix.o)
      std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >::~unique_ptr() in leveldb-library(env_posix.o)
      std::__1::thread::thread<void (*&)(void*), void*&, void>(void (*&)(void*), void*&) in leveldb-library(env_posix.o)
  "std::__1::__thread_local_data()", referenced from:
      void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(leveldb::(anonymous namespace)::PosixEnv*), leveldb::(anonymous namespace)::PosixEnv*> >(void*) in leveldb-library(env_posix.o)
      void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(void*), void*> >(void*) in leveldb-library(env_posix.o)
  "std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
      -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o)
      leveldb::DBImpl::DeleteObsoleteFiles() in leveldb-library(db_impl.o)
      leveldb::DestroyDB(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::Options const&) in leveldb-library(db_impl.o)
      leveldb::Slice::ToString() const in leveldb-library(db_impl.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(char const*) in leveldb-library(status.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in leveldb-library(version_set.o)
      leveldb::Slice::ToString() const in leveldb-library(version_set.o)
      ...
  "operator delete(void*)", referenced from:
      -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB dataForKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB stringForKey:] in FirebaseDatabase(APLevelDB.o)
      leveldb::WriteBatch::WriteBatch() in leveldb-library(write_batch.o)
      leveldb::WriteBatch::~WriteBatch() in leveldb-library(write_batch.o)
      leveldb::WriteBatch::~WriteBatch() in leveldb-library(write_batch.o)
      leveldb::(anonymous namespace)::MemTableInserter::~MemTableInserter() in leveldb-library(write_batch.o)
      ...
  "___cxa_pure_virtual", referenced from:
      vtable for leveldb::WriteBatch::Handler in leveldb-library(write_batch.o)
      vtable for leveldb::DB in leveldb-library(db_impl.o)
      vtable for leveldb::Comparator in leveldb-library(comparator.o)
      vtable for leveldb::Cache in leveldb-library(cache.o)
      vtable for leveldb::FilterPolicy in leveldb-library(filter_policy.o)
      vtable for leveldb::Env in leveldb-library(env.o)
      vtable for leveldb::SequentialFile in leveldb-library(env.o)
      ...
  "std::__1::thread::detach()", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::Schedule(void (*)(void*), void*) in leveldb-library(env_posix.o)
      leveldb::(anonymous namespace)::PosixEnv::StartThread(void (*)(void*), void*) in leveldb-library(env_posix.o)
  "std::__1::mutex::~mutex()", referenced from:
      leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in leveldb-library(db_impl.o)
      leveldb::port::Mutex::~Mutex() in leveldb-library(db_impl.o)
      leveldb::DBImpl::~DBImpl() in leveldb-library(db_impl.o)
      leveldb::NewLRUCache(unsigned long) in leveldb-library(cache.o)
      leveldb::(anonymous namespace)::LRUCache::~LRUCache() in leveldb-library(cache.o)
      leveldb::port::Mutex::~Mutex() in leveldb-library(cache.o)
      leveldb::(anonymous namespace)::ShardedLRUCache::~ShardedLRUCache() in leveldb-library(cache.o)
      ...
  "___gxx_personality_v0", referenced from:
      +[APLevelDB levelDBWithPath:error:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB setData:forKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB setString:forKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB dataForKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB stringForKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB removeKey:] in FirebaseDatabase(APLevelDB.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, unsigned long, std::__1::allocator<char> const&)", referenced from:
      leveldb::(anonymous namespace)::PosixWritableFile::PosixWritableFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int) in leveldb-library(env_posix.o)
  "___cxa_free_exception", referenced from:
      std::__1::__throw_length_error(char const*) in leveldb-library(db_impl.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_set.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(version_edit.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(env_posix.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(block_builder.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(filter_block.o)
      std::__1::__throw_length_error(char const*) in leveldb-library(arena.o)
      ...
  "operator delete[](void*)", referenced from:
      -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB setData:forKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB setString:forKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB dataForKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB stringForKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB removeKey:] in FirebaseDatabase(APLevelDB.o)
      -[APLevelDB commitWriteBatch:] in FirebaseDatabase(APLevelDB.o)
      ...
  "std::logic_error::logic_error(char const*)", referenced from:
      std::length_error::length_error(char const*) in leveldb-library(db_impl.o)
      std::length_error::length_error(char const*) in leveldb-library(version_set.o)
      std::length_error::length_error(char const*) in leveldb-library(version_edit.o)
      std::length_error::length_error(char const*) in leveldb-library(env_posix.o)
      std::length_error::length_error(char const*) in leveldb-library(block_builder.o)
      std::length_error::length_error(char const*) in leveldb-library(filter_block.o)
      std::length_error::length_error(char const*) in leveldb-library(arena.o)
      ...
  "vtable for __cxxabiv1::__class_type_info", referenced from:
      typeinfo for leveldb::WriteBatch::Handler in leveldb-library(write_batch.o)
      typeinfo for leveldb::Snapshot in leveldb-library(db_impl.o)
      typeinfo for leveldb::DB in leveldb-library(db_impl.o)
      typeinfo for leveldb::Comparator in leveldb-library(comparator.o)
      typeinfo for leveldb::Cache in leveldb-library(cache.o)
      typeinfo for leveldb::FilterPolicy in leveldb-library(filter_policy.o)
      typeinfo for std::__1::basic_streambuf<char, std::__1::char_traits<char> > in leveldb-library(env_posix.o)
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "std::__1::ios_base::init(void*)", referenced from:
      leveldb::PosixLogger::Logv(char const*, __va_list_tag*) in leveldb-library(env_posix.o)
  "operator new(unsigned long)", referenced from:
      -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o)
      leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in leveldb-library(db_impl.o)
      leveldb::DBImpl::DeleteObsoleteFiles() in leveldb-library(db_impl.o)
      leveldb::DBImpl::RecoverLogFile(unsigned long long, bool, bool*, leveldb::VersionEdit*, unsigned long long*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::BackgroundCompaction() in leveldb-library(db_impl.o)
      leveldb::DBImpl::OpenCompactionOutputFile(leveldb::DBImpl::CompactionState*) in leveldb-library(db_impl.o)
      leveldb::DBImpl::NewInternalIterator(leveldb::ReadOptions const&, unsigned long long*, unsigned int*) in leveldb-library(db_impl.o)
      ...
  "___cxa_guard_release", referenced from:
      leveldb::BytewiseComparator() in leveldb-library(comparator.o)
      leveldb::Env::Default() in leveldb-library(env_posix.o)
      leveldb::crc32c::Extend(unsigned int, char const*, unsigned long) in leveldb-library(crc32c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

if I go back to 6.13 it does not have link errors.

Relevant Code:

Cartfile using 6.14, similar problem with 6.15 and 6.16 does not happen with 6.13:
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"==6.14
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json"==6.14
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.json"==6.14
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json"==6.14


@google-oss-bot

This comment has been minimized.

@paulb777
Copy link
Member

paulb777 commented Feb 4, 2020

Not sure why, but it looks like the C++ library is not being linked. This might help - https://stackoverflow.com/a/41729038/556617

@possen
Copy link
Author

possen commented Feb 4, 2020

That improved the situation now only get but this does not happen when I go back to 6.13.

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FIRInstallations", referenced from:
      objc-class-ref in FirebaseInstanceID(FIRInstanceID.o)
      objc-class-ref in FirebaseInstanceID(FIRInstanceIDTokenOperation.o)
  "_FIRInstallationIDDidChangeNotification", referenced from:
      -[FIRInstanceID observeFirebaseInstallationIDChanges] in FirebaseInstanceID(FIRInstanceID.o)
  "_kFIRInstallationIDDidChangeNotificationAppNameKey", referenced from:
      -[FIRInstanceID installationIDDidChangeNotificationReceived:] in FirebaseInstanceID(FIRInstanceID.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@possen
Copy link
Author

possen commented Feb 4, 2020

As a side note I do have -ObjC in Other Linker Flags.

@morganchen12
Copy link
Contributor

The last few missing symbols are from the FirebaseInstallatinos framework. It's a newer dependency, so it may not be linked into your project. Can you make sure it's included in your linked binaries and libraries in Xcode?

@possen
Copy link
Author

possen commented Feb 4, 2020

OK it links now after I added the PromisesObjC.framework and FirebaseInstallatinos framework.

Undefined symbols for architecture x86_64:
  "_FBLPromiseErrorDomain", referenced from:
      ___60-[FIRSecureStorage getObjectForKey:objectClass:accessGroup:]_block_invoke in FirebaseInstallations(FIRSecureStorage.o)
  "_OBJC_CLASS_$_FBLPromise", referenced from:
      objc-class-ref in FirebaseInstallations(FIRInstallationsIDController.o)
      objc-class-ref in FirebaseInstallations(FIRInstallationsAPIService.o)
      objc-class-ref in FirebaseInstallations(FIRInstallationsIIDStore.o)
      objc-class-ref in FirebaseInstallations(FIRSecureStorage.o)
      objc-class-ref in FirebaseInstallations(FIRInstallationsStore.o)
      objc-class-ref in FirebaseInstallations(FIRInstallationsIIDTokenStore.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

But it links now after adding that Promises library. I also had to add the -lc++ to my main app as well as my library. I tested this with 6.16.

@possen
Copy link
Author

possen commented Feb 4, 2020

Thanks, it would still be helpful to know why the -lc++ option has to be added in newer versions and maybe the docs need to be updated if this is the new requirement.

@paulb777
Copy link
Member

paulb777 commented Feb 4, 2020

the linker should pick it the -lc++ from the leveldb module.modulemap - Carthage/Build/iOS/leveldb-library.framework/Modules/module.modulemap

I'd like to see a reproducible example or other reports before updating the docs.

@possen
Copy link
Author

possen commented Feb 4, 2020

This is what the module map for levelDB looks like (6.16):

framework module leveldb-library {
umbrella header "leveldb-library.h"
export *
module * { export * }
  link "c++"
}
@possen
Copy link
Author

possen commented Feb 4, 2020

Looks unchanged to me for 6.13.

framework module leveldb-library {
umbrella header "leveldb-library.h"
export *
module * { export * }
  link "c++"
}
@paulb777
Copy link
Member

paulb777 commented Feb 5, 2020

Are you able to binary search between a project with the working 6.13.0 and not working 6.16.0 to see what's different?

This could also be an issue with a corrupt Xcode module cache in DerivedData. Does removing DerivedData and rebuilding make a difference?

@possen
Copy link
Author

possen commented Feb 6, 2020

I regularly delete DerivedData, in fact part of my build scripts because I have had so many issues with it. I will see if I can do a binary diff today. It is very consistent though and our project is not very complex, maybe I can create a small project to reproduce it for you.

@paulb777
Copy link
Member

paulb777 commented Feb 6, 2020

Sounds good. We can dive deeper with a repro case.

@nidegen
Copy link

nidegen commented Feb 11, 2020

hey I ran in the same issue. my repo is https://github.com/nidegen/Sketcher/tree/firebase

@nidegen
Copy link

nidegen commented Feb 11, 2020

Really looking forward to spm binary support 😄

@paulb777 paulb777 self-assigned this Feb 12, 2020
@paulb777
Copy link
Member

@nidegen Thanks for the testcase.

I've reproduced there and with the Database quickstart. Investigating ....

@paulb777 paulb777 added the zip-builder Tools related to building the zip file. label Feb 12, 2020
@paulb777
Copy link
Member

The problem is the FirebaseDatabase module map. See the bottom for the details.

It seems that since leveldb is not actually referenced as a module, the linker does not process its modulemap. The c++ reference must also be in the FirebaseDatabase module map.

We'll fix in the next release. In the meantime, a workaround is to reset the module map as below to the 6.13.0 version or to explicitly add libc++ to the Link Binary With Libraries Build Phase.

$ diff -r 6-17/FirebaseDatabase.framework/ 6-13/FirebaseDatabase.framework/
Binary files 6-17/FirebaseDatabase.framework/FirebaseDatabase and 6-13/FirebaseDatabase.framework/FirebaseDatabase differ
diff -r 6-17/FirebaseDatabase.framework/Modules/module.modulemap 6-13/FirebaseDatabase.framework/Modules/module.modulemap
5a6,8
>   link framework "Security"
>   link framework "SystemConfiguration"
>   link "c++"
@nidegen
Copy link

nidegen commented Feb 12, 2020

awesome, thanks for looking into! i actually remember to have linked it to libc++ in another project:)

looking forward to spm support;)

@possen
Copy link
Author

possen commented Feb 12, 2020

Yes, thank you, sorry I did not get a repro case to you, things got busy.

@nidegen
Copy link

nidegen commented Mar 2, 2020

i updated the demo project to 6.18, and the linking of sqlite and libc++ still seem to not be working: https://github.com/nidegen/Sketcher/tree/firebase

@firebase firebase locked and limited conversation to collaborators Mar 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: database Carthage zip-builder Tools related to building the zip file.
6 participants