XCode 15 Linker issue with protobuf

Hi again :slight_smile:

Due to the release of iOS 17, I had to update XCode to version 15. When making an iOS build from Unity with the Pulse Engine version from before last week (last week the version on gitlab was updated with a new Google.Protobuf.dll ), it builds fine.

But when making a iOS build with the latest commits, XCode gives this error :

ld: Undefined symbols:
  _AbslInternalSpinLockWake_lts_20230802, referenced from:
      void absl::lts_20230802::base_internal::CallOnceImpl<void (*)(google::protobuf::FieldDescriptor const*), google::protobuf::FieldDescriptor const*>(std::__1::atomic<unsigned int>*, absl::lts_20230802::base_internal::SchedulingMode, void (*&&)(google::protobuf::FieldDescriptor const*), google::protobuf::FieldDescriptor const*&&) in libprotobuf.a[2](any.o)
      void absl::lts_20230802::base_internal::CallOnceImpl<void (*)(google::protobuf::FileDescriptorTables const*), google::protobuf::FileDescriptorTables const*>(std::__1::atomic<unsigned int>*, absl::lts_20230802::base_internal::SchedulingMode, void (*&&)(google::protobuf::FileDescriptorTables const*), google::protobuf::FileDescriptorTables const*&&) in libprotobuf.a[13](descriptor.o)
      void absl::lts_20230802::base_internal::CallOnceImpl<void (&)(google::protobuf::FileDescriptorTables const*), google::protobuf::FileDescriptorTables const*>(std::__1::atomic<unsigned int>*, absl::lts_20230802::base_internal::SchedulingMode, void (&)(google::protobuf::FileDescriptorTables const*), google::protobuf::FileDescriptorTables const*&&) in libprotobuf.a[13](descriptor.o)
      void absl::lts_20230802::base_internal::CallOnceImpl<void (&)(std::__1::pair<google::protobuf::FileDescriptorTables const*, google::protobuf::SourceCodeInfo const*>*), std::__1::pair<google::protobuf::FileDescriptorTables const*, google::protobuf::SourceCodeInfo const*>*>(std::__1::atomic<unsigned int>*, absl::lts_20230802::base_internal::SchedulingMode, void (&)(std::__1::pair<google::protobuf::FileDescriptorTables const*, google::protobuf::SourceCodeInfo const*>*), std::__1::pair<google::protobuf::FileDescriptorTables const*, google::protobuf::SourceCodeInfo const*>*&&) in libprotobuf.a[13](descriptor.o)
      void absl::lts_20230802::base_internal::CallOnceImpl<void google::protobuf::internal::ExtensionIdentifier<google::protobuf::FeatureSet, google::protobuf::internal::MessageTypeTraits<pb::CppFeatures>, (unsigned char)11, false>::LazyRegister<pb::CppFeatures, google::protobuf::Feature

Any clue what changed in the latest protobuf version that makes XCode (15) go crazy?

Thanks in advance,
Tim

Yeah, I know what this is.
I either need to provide you the absl libraries (Way too many)
Or I believe I can rework how I build protobuf to get that absl code in the libprotobuf.a rather than separate libraries

Let me try the later first, will be cleaner

Here are the absl libraries if you want to get moving
Just drop them in the dir with the other iOS libs in the Pulse asset

Thanks for the quick response again! Using the absl libraries make a difference, the previous errors are gone but a couple of new ones are still there. Maybe you have another indication how to fix that?

ld: Undefined symbols:
  utf8_range::IsStructurallyValid(std::__1::basic_string_view<char, std::__1::char_traits<char>>), referenced from:
      google::protobuf::internal::TcParser::FastUS1(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      google::protobuf::internal::TcParser::FastUS1(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      google::protobuf::internal::TcParser::FastUS2(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      google::protobuf::internal::TcParser::FastUS2(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      google::protobuf::internal::TcParser::FastUR1(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      google::protobuf::internal::TcParser::FastUR1(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      google::protobuf::internal::TcParser::FastUR1(google::protobuf::MessageLite*, char const*, google::protobuf::internal::ParseContext*, google::protobuf::internal::TcFieldData, google::protobuf::internal::TcParseTableBase const*, unsigned long long) in libprotobuf.a[28](generated_message_tctable_lite.o)
      ...
clang: error: linker command failed with exit code 1 (use -v to see invocation)

sunova…

So protobuf is now dependent on the Abseil C++ library as well as a utf8 library
So I will need to provide static versions of those libraries for iOS (cant rework the protobuf build easily)
That is weird you were able to build with out them in a previous xcode version

I will have to update the repository later today when I get back to my mac

That is weird you were able to build with out them in a previous xcode version

Yeah I think it may be a bit confused about that… I guess it did build with it only with the XCode 15.

Here are the utf8 libs

Thanks a million Abray! We’ve got an error free build now :slight_smile:

1 Like