0

I'm trying to build an IOS app in XCode8 with some existing C++ code that uses Google Protobuf, but can't get it to work.

I tried using CocoaPods as described here and in other places.

Also tried some building scripts: script1, script2.

In all of the tries I eventually got:

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*)",

With a list of some more protobuf implementation functions that are missing.

Is there any other way to compile/use the protobuf library XCode for IOS app?

Community
  • 1
  • 1
Oren
  • 258
  • 1
  • 2
  • 10
  • Since the functions in questions are all ones that use `std::string`, I wonder if this has to do with: http://stackoverflow.com/questions/30124264/undefined-reference-to-googleprotobufinternalempty-string-abicxx11/30175210 – Kenton Varda Jan 24 '17 at 12:00

2 Answers2

0

If you want to integrate C++ code you have to change the file ending for the C++ code from .cpp to .mm. Have you done this?

Eike
  • 620
  • 4
  • 6
0

SOLVED: I had multiple versions of protobuf over my system from all the tries, and I accidentally mixed different versions for the includes, the lib, and the protoc generated files.

Oren
  • 258
  • 1
  • 2
  • 10