我在我的原生 iOS 应用程序(一堆 .a 库)中使用第三方框架。我的应用程序是使用 XCode 5 基础 SDK 7.0 开发的。
当部署目标是 6.1(库和标头搜索路径都很好)时,库可以正常编译和链接。但是,当我将部署目标更改为 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。任何形式的帮助/指导都会很棒。