我在 native iOS应用程序(.a库群)中使用了第三方框架。我的应用程序是使用XCode 5基本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 '包含到依赖项中也解决了链接器错误

10-08 06:20