iphone - 部署目标为 7.0 时架构错误的 undefined symbol

标签 iphone ios xcode ios7 linker-errors

我在我的原生 iOS 应用程序(一堆 .a 库)中使用第三方框架。我的应用程序是使用 XCode 5 base SDK 7.0 开发的。

当部署目标为 6.1 时,库可以正常编译和链接(库和 header 搜索路径很好)。但是,当我将部署目标更改为 7.0 时,出现以下链接器错误:

Undefined symbols for architecture i386:
  "std::string::find_last_of(char const*, unsigned long) const", referenced from:
      GetExecutionDir(ECTemplateString<char>&, char*, bool) in myLibrary.a(moPlatForm.o)
  "std::string::find(char const*, unsigned long) const", referenced from:
      ParseLog(std::string const&, unsigned int&, CmoDateTime&, int&, std::string&) in myLibrary.a(AppLog.o)
  "std::string::size() const", referenced from:
      mo::CmoParam::WriteToStream(void*, mo::STREAM_STATE*) in myLibrary.a(moParams.o)
  "std::string::c_str() const", referenced from:
      GetExecutionDir(ECTemplateString<char>&, char*, bool) in myLibrary.a(moPlatForm.o)
      CMocaFileTransfer::UpdateParamsForGetTraceFiles(mo::CmoParamList&, long) in myLibrary.a(RobieFileTransfer.o)
      CMocaFileTransfer::AddTraceFileForUpload(std::string const&, std::string const&) in myLibrary.a(RobieFileTransfer.o)
      CMocaFileTransfer::CreateParamsForSendTraceFiles(mo::CmoObject&) in myLibrary.a(RobieFileTransfer.o)
      mo::CmoParam::WriteToStream(void*, mo::STREAM_STATE*) in myLibrary.a(moParams.o)
      ParseLog(std::string const&, unsigned int&, CmoDateTime&, int&, std::string&) in myLibrary.a(AppLog.o)
      CAppLog::LogExists(unsigned int) in myLibrary.a(AppLog.o)
      ...

库有点旧,我不确定是否存在兼容性问题。我不打算支持 iOS 6,所以我需要将部署目标设置为 7.0。任何形式的帮助/指导都会很棒。

最佳答案

对我来说,将“stdc++.6.0.9.dylib”而不是“stdc++.dylib”包含到依赖项中也解决了链接器错误

关于iphone - 部署目标为 7.0 时架构错误的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19271856/

相关文章:

iPhone - 从视频文件中分离音频并将其保存到单独的文件中

iphone - UIButton - 我们应该释放还是不释放?

ios - AVAudioSession 配置给别人录音播放

iphone - GKTurnBasedMatch matchData 的最大大小

iphone - 可以选择 iOS 基础 sdk 吗?

iphone - UITableView 更新时需要注意什么? (例如锁定它?)

iphone - 核心情节: x-Axis should remain visible while scrolling horizontally (or vice versa)

ios - 如何在 Xcode 4.3 中成功使用 BOOL

c# - 使用 moon apns 设置内容可用

objective-c - 注册最后的鼠标位置以实现平滑绘图