[英]Use C++ Protobuf in XCode8 IOS app
我正在嘗試使用一些使用Google Protobuf的現有C ++代碼在XCode8中構建IOS應用程序,但無法使其正常工作。
我嘗試按此處和其他地方所述使用CocoaPods。
還嘗試了一些構建腳本: script1 , script2 。
在所有嘗試中,我最終得到:
Undefined symbols for architecture arm64:
"google_public::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google_public::protobuf::io::CodedOutputStream*)",
"google_public::protobuf::internal::WireFormat::VerifyUTF8StringFallback(char const*, int, google_public::protobuf::internal::WireFormat::Operation, char const*)",
"google_public::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned char*)",
帶有一些缺少的protobuf實現功能的列表。
還有其他方法可以編譯/使用IOS應用程序的protobuf庫XCode嗎?
如果要集成C ++代碼,則必須將C ++代碼結尾的文件從.cpp更改為.mm。 你做完了嗎?
解決:在所有嘗試中,我的系統上都有多個版本的protobuf,並且我意外地將include,lib和protoc生成的文件的不同版本混合在一起。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.