【发布时间】:2023-03-19 12:16:01
【问题描述】:
我一直在尝试将 firebase 框架添加到我的 ios 应用程序中。我按照这里的说明进行操作:https://www.firebase.com/docs/ios-quickstart.html。当我尝试编译我的项目,甚至是 firebase 模板项目时,我得到了大量的链接器错误。 (如果有人感兴趣,我可以将它们粘贴在这里,但文本很多)firebase 框架需要这些框架,我确保将它们全部包含在内。
libicucore.dylib
CFNetwork.framework
Security.framework
SystemConfiguration.framework
还有其他一些我没有列出的框架吗?我不知道是怎么回事。感谢您的帮助!
编辑:这是错误
架构 i386 的未定义符号: “std::1::basic_string, std::__1::allocator >::compare(char const*) const”,引用自: Firebase 中的 leveldb::VersionSet::Recover()(version_set.o) “std::_1::_vector_base_common::__throw_length_error() const”,引用自: void std::_1::vector >::_push_back_slow_path(leveldb::Iterator* const&) 在 Firebase(db_impl.o) Firebase 中的 void std::_1::vector >::_push_back_slow_path(leveldb::DBImpl::CompactionState::Output const&)(db_impl.o) Firebase(db_impl.o) 中的 void std::_1::vector >::_push_back_slow_path(unsigned long long const&) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path const>(std::__1::pair const&) 在 Firebase(db_impl.o) std::__1::enable_if<__is_forward_iterator>::value, std::_1::_wrap_iter >::type std::_1::vector >::insert >( Firebase 中的 std::_1::__wrap_iter、std::_1::_wrap_iter、std::_1::_wrap_iter)(version_set.o ) Firebase 中的 std::_1::vector >::_append(unsigned long)(version_set.o) std::__1::enable_if<:value void>::type std::__1::vector >::assign(leveldb::FileMetaData*, leveldb::FileMetaData*) 在Firebase(version_set.o) ... “std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long)”,引用自: -[APLevelDB initWithPath:error:] 在 Firebase(APLevelDB.o) Firebase 中的 leveldb::DBImpl::NewDB()(db_impl.o) Firebase 中的 leveldb::Status::ToString() 常量(status.o) Firebase 中的 leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*)(version_set.o) Firebase 中的 leveldb::VersionSet::SetupOtherInputs(leveldb::Compaction*)(version_set.o) Firebase 中的 leveldb::VersionSet::Builder::Apply(leveldb::VersionEdit*)(version_set.o) Firebase 中的 leveldb::SetCurrentFile(leveldb::Env*, std::__1::basic_string, std::__1::allocator > const&, unsigned long long) (filename.o) ... “std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long, unsigned long)”,引用自: Firebase 中的 leveldb::DBImpl::DeleteObsoleteFiles()(db_impl.o) Firebase 中的 leveldb::DestroyDB(std::__1::basic_string, std::__1::allocator > const&, leveldb::Options const&) (db_impl.o) Firebase 中的 leveldb::VersionSet::Recover()(version_set.o) Firebase 中的 leveldb::MakeFileName(std::__1::basic_string, std::__1::allocator > const&, unsigned long long, char const*) (filename.o) Firebase 中的 leveldb::DescriptorFileName(std::__1::basic_string, std::__1::allocator > const&, unsigned long long) (filename.o) Firebase 中的 leveldb::CurrentFileName(std::__1::basic_string, std::__1::allocator > const&)(filename.o) Firebase 中的 leveldb::LockFileName(std::__1::basic_string, std::__1::allocator > const&)(filename.o) ... “std::__1::basic_string, std::__1::allocator >::append(char const*)”,引用自: Firebase 中的 leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string, std::__1::allocator >*) (db_impl.o) Firebase 中的 leveldb::Version::DebugString() const(version_set.o) Firebase 中的 leveldb::VersionEdit::DebugString() const(version_edit.o) Firebase 中的 leveldb::TableBuilder::Finish()(table_builder.o) Firebase 中的 leveldb::ParsedInternalKey::DebugString() const(dbformat.o) Firebase 中的 leveldb::AppendNumberTo(std::__1::basic_string, std::__1::allocator >*, unsigned long long) (logging.o) Firebase 中的 leveldb::AppendEscapedStringTo(std::__1::basic_string, std::__1::allocator >*, leveldb::Slice const&) (logging.o) ... “std::__1::basic_string, std::__1::allocator >::append(char const*, unsigned long)”,引用自: Firebase 中的 leveldb::WriteBatchInternal::Append(leveldb::WriteBatch*, leveldb::WriteBatch const*) (write_batch.o) Firebase 中的 leveldb::DBImpl::DeleteObsoleteFiles()(db_impl.o) Firebase 中的 leveldb::DestroyDB(std::__1::basic_string, std::__1::allocator > const&, leveldb::Options const&) (db_impl.o) Firebase 中的 leveldb::Status::ToString() 常量(status.o) Firebase 中的 leveldb::Version::DebugString() const(version_set.o) Firebase 中的 leveldb::VersionSet::Recover()(version_set.o) Firebase 中的 leveldb::MakeFileName(std::__1::basic_string, std::__1::allocator > const&, unsigned long long, char const*) (filename.o) ... “std::__1::basic_string, std::__1::allocator >::assign(char const*)”,引用自: Firebase 中的 leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string, std::__1::allocator >*) (db_impl.o) Firebase 中的 leveldb::InternalKey::DebugString() const(dbformat.o) leveldb::(匿名命名空间)::PosixEnv::GetTestDirectory(std::__1::basic_string, std::__1::allocator >*) 在 Firebase(env_posix.o) “std::__1::basic_string, std::__1::allocator >::assign(char const*, unsigned long)”,引用自: Firebase 中的 leveldb::WriteBatchInternal::SetContents(leveldb::WriteBatch*, leveldb::Slice const&)(write_batch.o) Firebase 中的 leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*)(db_impl.o) leveldb::BuildTable(std::__1::basic_string, std::__1::allocator > const&, leveldb::Env*, leveldb::Options const&, leveldb::TableCache*, leveldb::Iterator*, leveldb:: Firebase(builder.o) 中的 FileMetaData*) Firebase 中的 leveldb::SaveValue(void*, leveldb::Slice const&, leveldb::Slice const&) (version_set.o) Firebase 中的 leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*)(version_set.o) Firebase 中的 leveldb::VersionEdit::DecodeFrom(leveldb::Slice const&)(version_edit.o) Firebase 中的 leveldb::TableBuilder::Add(leveldb::Slice const&, leveldb::Slice const&)(table_builder.o) ... “std::__1::basic_string, std::__1::allocator >::resize(unsigned long, char)”,引用自: Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::Clear()(write_batch.o) Firebase 中的 leveldb::VersionSet::Recover()(version_set.o) leveldb::(匿名命名空间)::BytewiseComparatorImpl::FindShortestSeparator(std::__1::basic_string, std::__1::allocator >*, leveldb::Slice const&) const in Firebase(comparator.o) leveldb::(匿名命名空间)::BytewiseComparatorImpl::FindShortSuccessor(std::__1::basic_string, std::__1::allocator >*) const in Firebase(comparator.o) Firebase 中的 leveldb::BlockBuilder::Add(leveldb::Slice const&, leveldb::Slice const&)(block_builder.o) ... “std::__1::basic_string, std::__1::allocator >::push_back(char)”,引用自: Firebase 中的 leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)(write_batch.o) Firebase 中的 leveldb::WriteBatch::Delete(leveldb::Slice const&)(write_batch.o) Firebase 中的 leveldb::Version::DebugString() const(version_set.o) Firebase 中的 leveldb::AppendEscapedStringTo(std::__1::basic_string, std::__1::allocator >*, leveldb::Slice const&) (logging.o) Firebase 中的 leveldb::EscapeString(leveldb::Slice const&)(logging.o) Firebase 中的 leveldb::FilterBlockBuilder::Finish()(filter_block.o) “std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&)”,引用自: Firebase 中的 leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) (db_impl.o) Firebase 中的 leveldb::DBImpl::OpenCompactionOutputFile(leveldb::DBImpl::CompactionState*)(db_impl.o) Firebase 中的 leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) (db_impl.o) Firebase 中的 void std::_1::vector >::_push_back_slow_path(leveldb::DBImpl::CompactionState::Output const&)(db_impl.o) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path const>(std::__1::pair const&) 在 Firebase(db_impl.o) std::_1::vector, std::__1::allocator > >::_swap_out_circular_buffer(std::_1::_split_buffer, std::__1: :allocator >&>&) 在 Firebase(db_impl.o) Firebase 中的 leveldb::Status::ToString() 常量(status.o) ... “std::__1::basic_string, std::__1::allocator >::~basic_string()”,引用自: -[APLevelDB initWithPath:error:] 在 Firebase(APLevelDB.o) - [APLevelDB dataForKey:] 在 Firebase(APLevelDB.o) -[APLevelDB stringForKey:] 在 Firebase(APLevelDB.o) Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::~WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::~WriteBatch()(write_batch.o) ... “std::__1::basic_string, std::__1::allocator >::operator=(std::__1::basic_string, std::__1::allocator > const&)”,引用自: Firebase 中的 leveldb::DBImpl::NewDB()(db_impl.o) Firebase 中的 leveldb::DBImpl::TEST_CompactRange(int, leveldb::Slice const*, leveldb::Slice const*) (db_impl.o) Firebase 中的 leveldb::DBImpl::BackgroundCompaction()(db_impl.o) Firebase 中的 leveldb::DBImpl::GetProperty(leveldb::Slice const&, std::__1::basic_string, std::__1::allocator >*) (db_impl.o) Firebase 中的 leveldb::VersionEdit::AddFile(int, unsigned long long, unsigned long long, leveldb::InternalKey const&, leveldb::InternalKey const&) (db_impl.o) Firebase 中的 leveldb::VersionSet::LogAndApply(leveldb::VersionEdit*, leveldb::port::Mutex*) (version_set.o) Firebase 中的 leveldb::VersionSet::WriteSnapshot(leveldb::log::Writer*)(version_set.o) ... "void std::_1::_sort&, unsigned long long*>(unsigned long long*, unsigned long long*, std::_1::_less&) ",引用自: Firebase 中的 leveldb::DBImpl::Recover(leveldb::VersionEdit*)(db_impl.o) “std::terminate()”,引用自: Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::SanitizeOptions(std::__1::basic_string, std::__1::allocator > const&, leveldb::InternalKeyComparator const*, leveldb::InternalFilterPolicy const*, leveldb::Options const&) 在 Firebase(db_impl.o) Firebase 中的 leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) (db_impl.o) Firebase 中的 leveldb::DBImpl::~DBImpl()(db_impl.o) Firebase 中的 leveldb::DBImpl::NewDB()(db_impl.o) Firebase 中的 leveldb::DBImpl::MaybeIgnoreError(leveldb::Status*) const(db_impl.o) ... “_cxxabiv1::_class_type_info 的 vtable”,引用自: Firebase 中 leveldb::WriteBatch::Handler 的类型信息(write_batch.o) Firebase 中 leveldb::DB 的 typeinfo(db_impl.o) Firebase 中 leveldb::Snapshot 的 typeinfo(db_impl.o) Firebase 中 leveldb::Comparator 的类型信息(comparator.o) Firebase 中 leveldb::Cache 的 typeinfo(cache.o) Firebase 中 leveldb::FilterPolicy 的类型信息(filter_policy.o) Firebase 中 leveldb::Env 的类型信息(env.o) ... 注意:缺少 vtable 通常意味着第一个非内联虚拟成员函数没有定义。 “_cxxabiv1::_si_class_type_info 的 vtable”,引用自: Firebase 中 leveldb::(anonymous namespace)::MemTableInserter 的 typeinfo(write_batch.o) Firebase 中 leveldb::DBImpl 的 typeinfo(db_impl.o) leveldb::DBImpl::RecoverLogFile(unsigned long long, leveldb::VersionEdit*, unsigned long long*)::LogReporter in Firebase(db_impl.o) 的 typeinfo Firebase 中 leveldb::SnapshotImpl 的类型信息(db_impl.o) Firebase 中 leveldb::VersionSet::Recover()::LogReporter 的 typeinfo(version_set.o) Firebase 中 leveldb::Version::LevelFileNumIterator 的 typeinfo(version_set.o) Firebase 中 leveldb::(anonymous namespace)::BytewiseComparatorImpl 的 typeinfo(comparator.o) ... 注意:缺少 vtable 通常意味着第一个非内联虚拟成员函数没有定义。 “运算符删除”,引用自: -[APLevelDB initWithPath:error:] 在 Firebase(APLevelDB.o) -[APLevelDB setData:forKey:] 在 Firebase(APLevelDB.o) -[APLevelDB setString:forKey:] 在 Firebase(APLevelDB.o) - [APLevelDB dataForKey:] 在 Firebase(APLevelDB.o) -[APLevelDB stringForKey:] 在 Firebase(APLevelDB.o) -[APLevelDB removeKey:] 在 Firebase(APLevelDB.o) -[APLevelDB commitWriteBatch:] 在 Firebase (APLevelDB.o) ... “operator delete(void*)”,引用自: Firebase 中的 leveldb::WriteBatch::Handler::~Handler()(write_batch.o) Firebase 中的 leveldb::(匿名命名空间)::MemTableInserter::~MemTableInserter()(write_batch.o) Firebase 中的 leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) (db_impl.o) Firebase 中的 leveldb::DBImpl::~DBImpl()(db_impl.o) Firebase 中的 leveldb::DBImpl::~DBImpl()(db_impl.o) Firebase 中的 leveldb::DBImpl::DeleteObsoleteFiles()(db_impl.o) Firebase 中的 leveldb::DBImpl::Recover(leveldb::VersionEdit*)(db_impl.o) ... “operator new[](unsigned long)”,引用自: Firebase 中的 leveldb::Status::CopyState(char const*)(status.o) Firebase 中的 leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&) (status.o) Firebase 中的 leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&) (status.o) Firebase 中的 leveldb::VersionSet::MakeInputIterator(leveldb::Compaction*)(version_set.o) Firebase 中的 leveldb::(匿名命名空间)::HandleTable::Resize()(cache.o) Firebase 中的 leveldb::LookupKey::LookupKey(leveldb::Slice const&, unsigned long long)(dbformat.o) Firebase 中的 leveldb::LookupKey::LookupKey(leveldb::Slice const&, unsigned long long)(dbformat.o) ... “operator new(unsigned long)”,引用自: Firebase 中的 leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) (db_impl.o) Firebase 中的 leveldb::DBImpl::RecoverLogFile(unsigned long long, leveldb::VersionEdit*, unsigned long long*) (db_impl.o) Firebase 中的 leveldb::DBImpl::BackgroundCompaction()(db_impl.o) Firebase 中的 leveldb::DBImpl::OpenCompactionOutputFile(leveldb::DBImpl::CompactionState*)(db_impl.o) Firebase 中的 leveldb::DBImpl::NewInternalIterator(leveldb::ReadOptions const&, unsigned long long*) (db_impl.o) Firebase 中的 leveldb::DBImpl::GetSnapshot()(db_impl.o) Firebase 中的 leveldb::DBImpl::MakeRoomForWrite(bool)(db_impl.o) ... “_cxa_begin_catch”,引用自: Firebase 中的 std::1::deque >::__add_back_capacity()(db_impl.o) leveldb::(匿名命名空间)::PosixEnv::Schedule(void ()(void), void*) in Firebase(env_posix.o) “_cxa_call_unexpected”,引用自: Firebase 中的 leveldb::DBImpl::DeleteObsoleteFiles()(db_impl.o) Firebase 中的 leveldb::DBImpl::Recover(leveldb::VersionEdit*)(db_impl.o) Firebase 中的 leveldb::DBImpl::CleanupCompaction(leveldb::DBImpl::CompactionState*)(db_impl.o) Firebase 中的 leveldb::DestroyDB(std::1::basic_string, std::__1::allocator > const&, leveldb::Options const&) (db_impl.o) Firebase 中的 void std::_1::vector >::_push_back_slow_path(leveldb::DBImpl::CompactionState::Output const&)(db_impl.o) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path const>(std::__1::pair const&) 在 Firebase(db_impl.o) Firebase 中的 leveldb::VersionEdit::~VersionEdit()(db_impl.o) ... “_cxa_end_catch”,引用自: Firebase 中的 std::1::deque >::__add_back_capacity()(db_impl.o) leveldb::(匿名命名空间)::PosixEnv::Schedule(void ()(void), void*) in Firebase(env_posix.o) “_cxa_pure_virtual”,引用自: Firebase 中 leveldb::WriteBatch::Handler 的 vtable(write_batch.o) Firebase 中 leveldb::DB 的 vtable(db_impl.o) Firebase 中 leveldb::Comparator 的 vtable(comparator.o) vtable for leveldb::Cache in Firebase(cache.o) Firebase 中 leveldb::FilterPolicy 的 vtable(filter_policy.o) Firebase 中 leveldb::Env 的 vtable(env.o) Firebase(env.o)中 leveldb::SequentialFile 的 vtable ... “_cxa_rethrow”,引用自: Firebase 中的 std::_1::deque >::_add_back_capacity()(db_impl.o) leveldb::(匿名命名空间)::PosixEnv::Schedule(void ()(void), void*) in Firebase(env_posix.o) "_gxx_personality_v0",引用自: Firebase 中的 Dwarf 异常展开信息 (__eh_frame) (APLevelDB.o) Firebase(write_batch.o)中的矮人异常展开信息(__eh_frame) Firebase 中的 Dwarf 异常展开信息 (__eh_frame) (db_impl.o) Firebase(status.o)中的矮人异常展开信息(__eh_frame) Firebase(builder.o)中的矮人异常展开信息(__eh_frame) Firebase(version_set.o)中的矮人异常展开信息(__eh_frame) Firebase(table_cache.o)中的矮人异常展开信息(__eh_frame) ... Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 leveldb::WriteBatch::WriteBatch()(write_batch.o) Firebase 中的 Dwarf 异常展开信息 (__eh_frame) (APLevelDB.o) Firebase(write_batch.o)中的矮人异常展开信息(__eh_frame) Firebase 中的 Dwarf 异常展开信息 (__eh_frame) (db_impl.o) Firebase(status.o)中的矮人异常展开信息(__eh_frame) Firebase(builder.o)中的矮人异常展开信息(__eh_frame) Firebase(version_set.o)中的矮人异常展开信息(__eh_frame) Firebase(table_cache.o)中的矮人异常展开信息(__eh_frame) ... Firebase 中的 leveldb::SanitizeOptions(std::__1::basic_string, std::__1::allocator > const&, leveldb::InternalKeyComparator const*, leveldb::InternalFilterPolicy const*, leveldb::Options const&) 在 Firebase(db_impl.o) Firebase 中的 leveldb::DBImpl::DBImpl(leveldb::Options const&, std::__1::basic_string, std::__1::allocator > const&) (db_impl.o) Firebase 中的 leveldb::DBImpl::~DBImpl()(db_impl.o) ... ld:未找到体系结构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
【问题讨论】:
-
您需要在构建设置中的“其他链接器标志”下添加它: -ObjC 。你有没有在你的链接器标志中添加这个?
-
是的,我添加了 -ObjC 标志。
-
你能把错误贴出来吗?
-
在构建设置中检查你的标题搜索路径
-
我应该在那里寻找什么?
标签: ios objective-c firebase