# XCode 15 Linker issue with protobuf

**URL:** https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138
**Category:** Pulse Physiology Engine
**Created:** [September 27, 2023, 10:11am UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138 "2023-09-27T10:11:42Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Timbo](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/t/ad7895/32.png) [@Timbo](https://discourse.kitware.com/u/Timbo)
#### Post date: [September 27, 2023, 10:11am UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/1 "2023-09-27T10:11:42Z")

</div>

Hi again 🙂

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**](https://gitlab.kitware.com/physiology/unity/-/commit/01b4dce523faf2be6971b865ba9bfdddce4abf29#ae2fbcca8b32588ed643461bf32441be313ee672)), it builds fine.

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

 ![CleanShot 2023-09-27 at 12.04.56](https://discourse.kitware.com/uploads/default/original/1X/30603de741b9c7d1b94a3ed5fc646121ca06c488.jpeg)

```auto
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

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [September 27, 2023, 12:42pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/2 "2023-09-27T12:42:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [September 27, 2023, 12:46pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/3 "2023-09-27T12:46:17Z")

</div>

Here are [the absl libraries](https://data.kitware.com/api/v1/item/651423adc8ab4576ca99f53a/download) if you want to get moving  
Just drop them in the dir with the other iOS libs in the Pulse asset

---

<div class="post-metadata">

### Author: ![Timbo](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/t/ad7895/32.png) [@Timbo](https://discourse.kitware.com/u/Timbo)
#### Post date: [September 27, 2023, 1:27pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/4 "2023-09-27T13:27:31Z")

</div>

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?

```auto
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)

```

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [September 27, 2023, 1:53pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/5 "2023-09-27T13:53:28Z")

</div>

sunova…

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [September 27, 2023, 5:45pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/6 "2023-09-27T17:45:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Timbo](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/t/ad7895/32.png) [@Timbo](https://discourse.kitware.com/u/Timbo)
#### Post date: [September 28, 2023, 6:26am UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/7 "2023-09-28T06:26:25Z")

</div>

> 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.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [September 28, 2023, 1:04pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/8 "2023-09-28T13:04:38Z")

</div>

[Here are the utf8 libs](https://data.kitware.com/api/v1/item/6515797fc8ab4576ca99f5d0/download)

---

<div class="post-metadata">

### Author: ![Timbo](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/t/ad7895/32.png) [@Timbo](https://discourse.kitware.com/u/Timbo)
#### Post date: [September 28, 2023, 9:45pm UTC](https://discourse.kitware.com/t/xcode-15-linker-issue-with-protobuf/1138/9 "2023-09-28T21:45:10Z")

</div>

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