繁体   English   中英

在XCode8 IOS应用中使用C ++ Protobuf

[英]Use C++ Protobuf in XCode8 IOS app

我正在尝试使用一些使用Google Protobuf的现有C ++代码在XCode8中构建IOS应用程序,但无法使其正常工作。

我尝试按此处和其他地方所述使用CocoaPods。

还尝试了一些构建脚本: script1script2

在所有尝试中,我最终得到:

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM