Undefined symbols with Xcode 13/Realm 10.13.0

I trying to compile Realm 10.13.0 in Xcode 13 beta 5, integrated with Carthage, but I’m getting a bunch of compilation (linker) errors (98 to be exact). Inserted below. Anyone have an idea what I’m doing wrong?

The error output is miles long, but this is the beginning. Let me know if you want the whole thing:

Undefined symbols for architecture x86_64:
  "_deflateReset", referenced from:
      realm::_impl::compression::compress_file_in_blocks(char const*, char const*, unsigned long&, unsigned long&) in Realm(compression.o)
  "_inflateReset", referenced from:
      realm::_impl::compression::integrate_compressed_blocks_in_realm_file(char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::util::Optional<std::__1::array<char, 64ul> > const&, unsigned long long&) in Realm(compression.o)
      realm::_impl::compression::decompress_file_from_blocks(char const*, char const*, long long&, long long&) in Realm(compression.o)
  "_inflateEnd", referenced from:
      realm::_impl::compression::decompress(char const*, unsigned long, char*, unsigned long) in Realm(compression.o)
      realm::_impl::compression::decompress_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, long long&, long long&) in Realm(compression.o)
      realm::_impl::compression::integrate_compressed_blocks_in_realm_file(char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::util::Optional<std::__1::array<char, 64ul> > const&, unsigned long long&) in Realm(compression.o)
      realm::_impl::compression::decompress_file_from_blocks(char const*, char const*, long long&, long long&) in Realm(compression.o)
      realm::_impl::compression::decompress_block(char const*, unsigned long, char*, unsigned long&) in Realm(compression.o)
  "_deflate", referenced from:
      realm::_impl::compression::compress(char const*, unsigned long, char*, unsigned long, unsigned long&, int, realm::_impl::compression::Alloc*) in Realm(compression.o)
      realm::_impl::compression::compress_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, long long&, long long&) in Realm(compression.o)
      realm::_impl::compression::compress_block_with_header(char const*, unsigned long, char*, unsigned long, unsigned long&) in Realm(compression.o)
      realm::_impl::compression::compress_file_in_blocks(char const*, char const*, unsigned long&, unsigned long&) in Realm(compression.o)
  "_deflateEnd", referenced from:
      realm::_impl::compression::compress_bound(char const*, unsigned long, unsigned long&, int) in Realm(compression.o)
      realm::_impl::compression::compress(char const*, unsigned long, char*, unsigned long, unsigned long&, int, realm::_impl::compression::Alloc*) in Realm(compression.o)
      realm::_impl::compression::compress_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, long long&, long long&) in Realm(compression.o)
      realm::_impl::compression::compress_block_with_header(char const*, unsigned long, char*, unsigned long, unsigned long&) in Realm(compression.o)
      realm::_impl::compression::compress_file_in_blocks(char const*, char const*, unsigned long&, unsigned long&) in Realm(compression.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::get()", referenced from:
      realm::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&, realm::GlobalKey&) in Realm(global_key.o)
  "std::bad_alloc::~bad_alloc()", referenced from:
      realm::keychain::(anonymous namespace)::set_key(std::__1::vector<char, std::__1::allocator<char> > const&, __CFString const*, __CFString const*) in Realm(keychain_helper.o)
      realm::keychain::(anonymous namespace)::build_search_dictionary(__CFString const*, __CFString const*, realm::util::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >) in Realm(keychain_helper.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_istream<char, std::__1::char_traits<char> >&, bool)", referenced from:
      std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::operator>><char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in Realm(client_impl_base.o)
      std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::operator>><char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, char&) in Realm(client_impl_base.o)
      realm::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&, realm::GlobalKey&) in Realm(global_key.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned long long&)", referenced from:
      void realm::_impl::ClientProtocol::parse_message_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::tellg()", referenced from:
      void realm::_impl::ClientProtocol::parse_message_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
      void realm::_impl::ClientProtocol::parse_pong_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::seekg(std::__1::fpos<__mbstate_t>)", referenced from:
      void realm::_impl::ClientProtocol::parse_message_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned int&)", referenced from:
      realm::util::HTTPParserBase::parse_first_line_of_response(realm::StringData, realm::util::HTTPStatus&, realm::StringData&, realm::util::Logger&) in Realm(http.o)
  "std::__1::cerr", referenced from:
      realm::util::StderrLogger::do_log(realm::util::Logger::Level, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Realm(logger.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*)", referenced from:
      realm::util::FunctionRef<bool (realm::ColKey)>::FunctionRef<realm::Cluster::dump_objects(long long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const::$_4>(realm::Cluster::dump_objects(long long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const::$_4&&)::'lambda'(void*, realm::ColKey)::__invoke(void*, realm::ColKey) in Realm(cluster.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned long&)", referenced from:
      realm::util::HTTPParserBase::parse_header_line(unsigned long) in Realm(http.o)
      void realm::_impl::ClientProtocol::parse_message_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
  "std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)", referenced from:
      realm::_impl::NotifierPackage::package_and_wait(realm::util::Optional<unsigned long long>) in Realm(collection_notifier.o)
  "std::__1::condition_variable::notify_all()", referenced from:
      realm::_impl::RealmCoordinator::run_async_notifiers() in Realm(realm_coordinator.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(long long&)", referenced from:
      void realm::_impl::ClientProtocol::parse_message_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
      void realm::_impl::ClientProtocol::parse_pong_received<realm::_impl::ClientImplBase::Connection>(realm::_impl::ClientImplBase::Connection&, char const*, unsigned long) in Realm(client_impl_base.o)
  "std::__1::condition_variable::~condition_variable()", referenced from:
      realm::_impl::RealmCoordinator::~RealmCoordinator() in Realm(realm_coordinator.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::write(char const*, long)", referenced from:
      realm::util::format(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, std::initializer_list<realm::util::Printable>) in Realm(to_string.o)
      realm::util::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, realm::util::HTTPRequest const&) in Realm(http.o)
      realm::util::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, realm::util::HTTPResponse const&) in Realm(http.o)
      realm::util::make_http_host(bool, realm::util::BasicStringView<char, std::__1::char_traits<char> >, unsigned short) in Realm(http.o)
      realm::_impl::OutputStream::write(char const*, unsigned long) in Realm(output_stream.o)
      realm::_impl::OutputStream::do_write(char const*, unsigned long) in Realm(output_stream.o)
      realm::_impl::OutputStream::write_array(char const*, unsigned long, unsigned int) in Realm(output_stream.o)
      ...

@Mikkel_Selsoe_Sorens are you using the latest version of Carthage? Are you passing any flags to Carthage?

I’m using Carthage 0.38.0 (should be latest), passing --use-xcframeworks

Could you try with the installation steps mentioned here? Realm: Create reactive mobile apps in a fraction of the time

You mean as regular frameworks without the --use-xcframeworks option? I can try, but xc frameworks make cross-architecture compatibility much easier.