4
votes

I've been trying to add the firebase framework to my ios app. I was following the instructions here: https://www.firebase.com/docs/ios-quickstart.html. When I try to compile my project, or even the firebase template project I get a ton of linker erros. (I could paste them here if someone is interested but it's a lot of text) The firebase framework requires these frameworks and I've made sure to include them all.

libicucore.dylib
CFNetwork.framework
Security.framework
SystemConfiguration.framework

Is there some other framework I'm missing that wasn't listed? I have no idea what's going on. Thanks for the help!


Edit: Here are the errors

Undefined symbols for architecture i386: "std::1::basic_string, std::__1::allocator >::compare(char const*) const", referenced from: leveldb::VersionSet::Recover() in Firebase(version_set.o) "std::_1::_vector_base_common::__throw_length_error() const", referenced from: void std::_1::vector >::_push_back_slow_path(leveldb::Iterator* const&) in Firebase(db_impl.o) void std::_1::vector >::_push_back_slow_path(leveldb::DBImpl::CompactionState::Output const&) in Firebase(db_impl.o) void std::_1::vector >::_push_back_slow_path(unsigned long long const&) in Firebase(db_impl.o) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path const>(std::__1::pair const&) in Firebase(db_impl.o) std::__1::enable_if<__is_forward_iterator >::value, std::_1::_wrap_iter >::type std::_1::vector >::insert >(std::_1::__wrap_iter, std::_1::_wrap_iter, std::_1::_wrap_iter) in Firebase(version_set.o) std::_1::vector >::_append(unsigned long) in Firebase(version_set.o) std::__1::enable_if<__is_forward_iterator::value, void>::type std::__1::vector >::assign(leveldb::FileMetaData*, leveldb::FileMetaData*) in Firebase(version_set.o) ... "std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long)", referenced from: -[APLevelDB initWithPath:error:] in Firebase(APLevelDB.o) leveldb::DBImpl::NewDB() in Firebase(db_impl.o) leveldb::Status::ToString() const in Firebase(status.o) leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*) in Firebase(version_set.o) leveldb::VersionSet::SetupOtherInputs(leveldb::Compaction*) in Firebase(version_set.o) leveldb::VersionSet::Builder::Apply(leveldb::VersionEdit*) in Firebase(version_set.o) leveldb::SetCurrentFile(leveldb::Env*, std::__1::basic_string, std::__1::allocator > const&, unsigned long long) in Firebase(filename.o) ... "std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long, unsigned long)", referenced from: leveldb::DBImpl::DeleteObsoleteFiles() in Firebase(db_impl.o) leveldb::DestroyDB(std::__1::basic_string, std::__1::allocator > const&, leveldb::Options const&) in Firebase(db_impl.o) leveldb::VersionSet::Recover() in Firebase(version_set.o) leveldb::MakeFileName(std::__1::basic_string, std::__1::allocator > const&, unsigned long long, char const*) in Firebase(filename.o) leveldb::DescriptorFileName(std::__1::basic_string, std::__1::allocator > const&, unsigned long long) in Firebase(filename.o) leveldb::CurrentFileName(std::__1::basic_string, std::__1::allocator > const&) in Firebase(filename.o) leveldb::LockFileName(std::__1::basic_string, std::__1::allocator > const&) in Firebase(filename.o) ... "std::__1::basic_string, std::__1::allocator >::append(char const*)", referenced from: leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string, std::__1::allocator >*) in Firebase(db_impl.o) leveldb::Version::DebugString() const in Firebase(version_set.o) leveldb::VersionEdit::DebugString() const in Firebase(version_edit.o) leveldb::TableBuilder::Finish() in Firebase(table_builder.o) leveldb::ParsedInternalKey::DebugString() const in Firebase(dbformat.o) leveldb::AppendNumberTo(std::__1::basic_string, std::__1::allocator >*, unsigned long long) in Firebase(logging.o) leveldb::AppendEscapedStringTo(std::__1::basic_string, std::__1::allocator >*, leveldb::Slice const&) in Firebase(logging.o) ... "std::__1::basic_string, std::__1::allocator >::append(char const*, unsigned long)", referenced from: leveldb::WriteBatchInternal::Append(leveldb::WriteBatch*, leveldb::WriteBatch const*) in Firebase(write_batch.o) leveldb::DBImpl::DeleteObsoleteFiles() in Firebase(db_impl.o) leveldb::DestroyDB(std::__1::basic_string, std::__1::allocator > const&, leveldb::Options const&) in Firebase(db_impl.o) leveldb::Status::ToString() const in Firebase(status.o) leveldb::Version::DebugString() const in Firebase(version_set.o) leveldb::VersionSet::Recover() in Firebase(version_set.o) leveldb::MakeFileName(std::__1::basic_string, std::__1::allocator > const&, unsigned long long, char const*) in Firebase(filename.o) ... "std::__1::basic_string, std::__1::allocator >::assign(char const*)", referenced from: leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string, std::__1::allocator >*) in Firebase(db_impl.o) leveldb::InternalKey::DebugString() const in Firebase(dbformat.o) leveldb::(anonymous namespace)::PosixEnv::GetTestDirectory(std::__1::basic_string, std::__1::allocator >*) in Firebase(env_posix.o) "std::__1::basic_string, std::__1::allocator >::assign(char const*, unsigned long)", referenced from: leveldb::WriteBatchInternal::SetContents(leveldb::WriteBatch*, leveldb::Slice const&) in Firebase(write_batch.o) leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*) in Firebase(db_impl.o) leveldb::BuildTable(std::__1::basic_string, std::__1::allocator > const&, leveldb::Env*, leveldb::Options const&, leveldb::TableCache*, leveldb::Iterator*, leveldb::FileMetaData*) in Firebase(builder.o) leveldb::SaveValue(void*, leveldb::Slice const&, leveldb::Slice const&) in Firebase(version_set.o) leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*) in Firebase(version_set.o) leveldb::VersionEdit::DecodeFrom(leveldb::Slice const&) in Firebase(version_edit.o) leveldb::TableBuilder::Add(leveldb::Slice const&, leveldb::Slice const&) in Firebase(table_builder.o) ... "std::__1::basic_string, std::__1::allocator >::resize(unsigned long, char)", referenced from: leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::Clear() in Firebase(write_batch.o) leveldb::VersionSet::Recover() in Firebase(version_set.o) leveldb::(anonymous namespace)::BytewiseComparatorImpl::FindShortestSeparator(std::__1::basic_string, std::__1::allocator >*, leveldb::Slice const&) const in Firebase(comparator.o) leveldb::(anonymous namespace)::BytewiseComparatorImpl::FindShortSuccessor(std::__1::basic_string, std::__1::allocator >*) const in Firebase(comparator.o) leveldb::BlockBuilder::Add(leveldb::Slice const&, leveldb::Slice const&) in Firebase(block_builder.o) ... "std::__1::basic_string, std::__1::allocator >::push_back(char)", referenced from: leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&) in Firebase(write_batch.o) leveldb::WriteBatch::Delete(leveldb::Slice const&) in Firebase(write_batch.o) leveldb::Version::DebugString() const in Firebase(version_set.o) leveldb::AppendEscapedStringTo(std::__1::basic_string, std::__1::allocator >*, leveldb::Slice const&) in Firebase(logging.o) leveldb::EscapeString(leveldb::Slice const&) in Firebase(logging.o) leveldb::FilterBlockBuilder::Finish() in Firebase(filter_block.o) "std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&)", referenced from: leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) in Firebase(db_impl.o) leveldb::DBImpl::OpenCompactionOutputFile(leveldb::DBImpl::CompactionState*) in Firebase(db_impl.o) leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) in Firebase(db_impl.o) void std::_1::vector >::_push_back_slow_path(leveldb::DBImpl::CompactionState::Output const&) in Firebase(db_impl.o) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path const>(std::__1::pair const&) in Firebase(db_impl.o) std::_1::vector, std::__1::allocator > >::_swap_out_circular_buffer(std::_1::_split_buffer, std::__1::allocator >&>&) in Firebase(db_impl.o) leveldb::Status::ToString() const in Firebase(status.o) ... "std::__1::basic_string, std::__1::allocator >::~basic_string()", referenced from: -[APLevelDB initWithPath:error:] in Firebase(APLevelDB.o) -[APLevelDB dataForKey:] in Firebase(APLevelDB.o) -[APLevelDB stringForKey:] in Firebase(APLevelDB.o) leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::~WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::~WriteBatch() in Firebase(write_batch.o) ... "std::__1::basic_string, std::__1::allocator >::operator=(std::__1::basic_string, std::__1::allocator > const&)", referenced from: leveldb::DBImpl::NewDB() in Firebase(db_impl.o) leveldb::DBImpl::TEST_CompactRange(int, leveldb::Slice const*, leveldb::Slice const*) in Firebase(db_impl.o) leveldb::DBImpl::BackgroundCompaction() in Firebase(db_impl.o) leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string, std::__1::allocator >*) in Firebase(db_impl.o) leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) in Firebase(db_impl.o) leveldb::VersionSet::LogAndApply(leveldb::VersionEdit*, leveldb::port::Mutex*) in Firebase(version_set.o) leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*) in Firebase(version_set.o) ... "void std::_1::_sort&, unsigned long long*>(unsigned long long*, unsigned long long*, std::_1::_less&)", referenced from: leveldb::DBImpl::Recover(leveldb::VersionEdit*) in Firebase(db_impl.o) "std::terminate()", referenced from: leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::SanitizeOptions(std::__1::basic_string, std::__1::allocator > const&, leveldb::InternalKeyComparator const*, leveldb::InternalFilterPolicy const*, leveldb::Options const&) in Firebase(db_impl.o) leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) in Firebase(db_impl.o) leveldb::DBImpl::~DBImpl() in Firebase(db_impl.o) leveldb::DBImpl::NewDB() in Firebase(db_impl.o) leveldb::DBImpl::MaybeIgnoreError(leveldb::Status*) const in Firebase(db_impl.o) ... "vtable for _cxxabiv1::_class_type_info", referenced from: typeinfo for leveldb::WriteBatch::Handler in Firebase(write_batch.o) typeinfo for leveldb::DB in Firebase(db_impl.o) typeinfo for leveldb::Snapshot in Firebase(db_impl.o) typeinfo for leveldb::Comparator in Firebase(comparator.o) typeinfo for leveldb::Cache in Firebase(cache.o) typeinfo for leveldb::FilterPolicy in Firebase(filter_policy.o) typeinfo for leveldb::Env in Firebase(env.o) ... NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for _cxxabiv1::_si_class_type_info", referenced from: typeinfo for leveldb::(anonymous namespace)::MemTableInserter in Firebase(write_batch.o) typeinfo for leveldb::DBImpl in Firebase(db_impl.o) typeinfo for leveldb::DBImpl::RecoverLogFile(unsigned long long, leveldb::VersionEdit*, unsigned long long*)::LogReporter in Firebase(db_impl.o) typeinfo for leveldb::SnapshotImpl in Firebase(db_impl.o) typeinfo for leveldb::VersionSet::Recover()::LogReporter in Firebase(version_set.o) typeinfo for leveldb::Version::LevelFileNumIterator in Firebase(version_set.o) typeinfo for leveldb::(anonymous namespace)::BytewiseComparatorImpl in Firebase(comparator.o) ... NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "operator delete", referenced from: -[APLevelDB initWithPath:error:] in Firebase(APLevelDB.o) -[APLevelDB setData:forKey:] in Firebase(APLevelDB.o) -[APLevelDB setString:forKey:] in Firebase(APLevelDB.o) -[APLevelDB dataForKey:] in Firebase(APLevelDB.o) -[APLevelDB stringForKey:] in Firebase(APLevelDB.o) -[APLevelDB removeKey:] in Firebase(APLevelDB.o) -[APLevelDB commitWriteBatch:] in Firebase(APLevelDB.o) ... "operator delete(void*)", referenced from: leveldb::WriteBatch::Handler::~Handler() in Firebase(write_batch.o) leveldb::(anonymous namespace)::MemTableInserter::~MemTableInserter() in Firebase(write_batch.o) leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) in Firebase(db_impl.o) leveldb::DBImpl::~DBImpl() in Firebase(db_impl.o) leveldb::DBImpl::~DBImpl() in Firebase(db_impl.o) leveldb::DBImpl::DeleteObsoleteFiles() in Firebase(db_impl.o) leveldb::DBImpl::Recover(leveldb::VersionEdit*) in Firebase(db_impl.o) ... "operator new[](unsigned long)", referenced from: leveldb::Status::CopyState(char const*) in Firebase(status.o) leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&) in Firebase(status.o) leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&) in Firebase(status.o) leveldb::VersionSet::MakeInputIterator(leveldb::Compaction*) in Firebase(version_set.o) leveldb::(anonymous namespace)::HandleTable::Resize() in Firebase(cache.o) leveldb::LookupKey::LookupKey(leveldb::Slice const&, unsigned long long) in Firebase(dbformat.o) leveldb::LookupKey::LookupKey(leveldb::Slice const&, unsigned long long) in Firebase(dbformat.o) ... "operator new(unsigned long)", referenced from: leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) in Firebase(db_impl.o) leveldb::DBImpl::RecoverLogFile(unsigned long long, leveldb::VersionEdit*, unsigned long long*) in Firebase(db_impl.o) leveldb::DBImpl::BackgroundCompaction() in Firebase(db_impl.o) leveldb::DBImpl::OpenCompactionOutputFile(leveldb::DBImpl::CompactionState*) in Firebase(db_impl.o) leveldb::DBImpl::NewInternalIterator(leveldb::ReadOptions const&, unsigned long long*) in Firebase(db_impl.o) leveldb::DBImpl::GetSnapshot() in Firebase(db_impl.o) leveldb::DBImpl::MakeRoomForWrite(bool) in Firebase(db_impl.o) ... "_cxa_begin_catch", referenced from: std::1::deque >::__add_back_capacity() in Firebase(db_impl.o) leveldb::(anonymous namespace)::PosixEnv::Schedule(void ()(void), void*) in Firebase(env_posix.o) "_cxa_call_unexpected", referenced from: leveldb::DBImpl::DeleteObsoleteFiles() in Firebase(db_impl.o) leveldb::DBImpl::Recover(leveldb::VersionEdit*) in Firebase(db_impl.o) leveldb::DBImpl::CleanupCompaction(leveldb::DBImpl::CompactionState*) in Firebase(db_impl.o) leveldb::DestroyDB(std::1::basic_string, std::__1::allocator > const&, leveldb::Options const&) in Firebase(db_impl.o) void std::_1::vector >::_push_back_slow_path(leveldb::DBImpl::CompactionState::Output const&) in Firebase(db_impl.o) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path const>(std::__1::pair const&) in Firebase(db_impl.o) leveldb::VersionEdit::~VersionEdit() in Firebase(db_impl.o) ... "_cxa_end_catch", referenced from: std::1::deque >::__add_back_capacity() in Firebase(db_impl.o) leveldb::(anonymous namespace)::PosixEnv::Schedule(void ()(void), void*) in Firebase(env_posix.o) "_cxa_pure_virtual", referenced from: vtable for leveldb::WriteBatch::Handler in Firebase(write_batch.o) vtable for leveldb::DB in Firebase(db_impl.o) vtable for leveldb::Comparator in Firebase(comparator.o) vtable for leveldb::Cache in Firebase(cache.o) vtable for leveldb::FilterPolicy in Firebase(filter_policy.o) vtable for leveldb::Env in Firebase(env.o) vtable for leveldb::SequentialFile in Firebase(env.o) ... "_cxa_rethrow", referenced from: std::_1::deque >::_add_back_capacity() in Firebase(db_impl.o) leveldb::(anonymous namespace)::PosixEnv::Schedule(void ()(void), void*) in Firebase(env_posix.o) "_gxx_personality_v0", referenced from: Dwarf Exception Unwind Info (__eh_frame) in Firebase(APLevelDB.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(write_batch.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(db_impl.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(status.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(builder.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(version_set.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(table_cache.o) ... leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) leveldb::WriteBatch::WriteBatch() in Firebase(write_batch.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(APLevelDB.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(write_batch.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(db_impl.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(status.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(builder.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(version_set.o) Dwarf Exception Unwind Info (__eh_frame) in Firebase(table_cache.o) ... leveldb::SanitizeOptions(std::__1::basic_string, std::__1::allocator > const&, leveldb::InternalKeyComparator const*, leveldb::InternalFilterPolicy const*, leveldb::Options const&) in Firebase(db_impl.o) leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) in Firebase(db_impl.o) leveldb::DBImpl::~DBImpl() in Firebase(db_impl.o) ... ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

3
you'll need to add this under "other linker flags" in build settings: -ObjC . Have u added this in your linker flags?Sudha Tiwari
Yes, I have the -ObjC flag added.Connor
can u please post the error?Sudha Tiwari
check your header search path in the build settingsTendulkar
what should I be looking for there?Connor

3 Answers

3
votes

Sorry. We pushed a new version today that added a new dependency on libc++.dylib If you add that, it should build.

Note that there's also an issue with the current build that prevents building for arm64. Given that, you may want to just use the previous build: https://cdn.firebase.com/ObjC/Firebase.framework-1.0.9.zip

Else wait a day or so and we'll get the latest build straightened out.

Sorry for the inconvenience!

1
votes

Make sure that you have added -ObjC in your other linker flags in build settings. Also make sure that u have added the required framworks :

libicucore.dylib
CFNetwork.framework
Security.framework
SystemConfiguration.framework

Hope it will help.

0
votes

This is what has been mentioned on the firebase website..

3) Firebase makes use of Objective-C classes and categories, so you'll need to add this under "other linker flags" in build settings: -ObjC