Получить ссылку ссылку при использовании protobuf 3 в Xcode

Сначала я установил google protobuf-3.3 (protobuf-cpp-3.3.0.tar.gz), использовал xcode для создания кроссплатформенного игрового проекта, цель - ios, добавьте libprotobuf-lite.tbd и libprotobuf.tbd, затем создайте Файл test.proto выглядит так:

syntax = "proto3";

message Person {
  string name = 1;
}

используйте protoc для компиляции в файл cpp: test.pb.h,test.pb.cc при запуске проекта я получил 13 ошибок:

Undefined symbols for architecture arm64:
  "google::protobuf::Message::SpaceUsedLong() const", referenced from:
      vtable for Person in test.pb.o
  "google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)", referenced from:
      Person::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in test.pb.o
      Person::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in test.pb.o
      Person::InternalSerializeWithCachedSizesToArray(bool, unsigned char*) const in test.pb.o
  "google::protobuf::UnknownFieldSet::default_instance()", referenced from:
      google::protobuf::internal::InternalMetadataWithArena::default_instance() in test.pb.o
  "google::protobuf::io::CodedInputStream::ReadTagFallback(unsigned int)", referenced from:
      Person::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) in test.pb.o
  "google::protobuf::internal::RegisterAllTypes(google::protobuf::Metadata const*, int)", referenced from:
      protobuf_test_2eproto::(anonymous namespace)::protobuf_RegisterTypes(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in test.pb.o
...
...
...

0 ответов

Другие вопросы по тегам