0

我正在尝试libbfd在 MacOS 上构建。我还没有发现任何表明 Apple Clang 会提供类似功能的东西,所以我“卡”在 Homebrew 上。

链接到/usr/local/opt/binutils/lib/libbfd.a我得到很多未解决的符号,一些侦探工作表明至少有一些来自libiberty所以感谢https://stackoverflow.com/a/65978315/204658我解决了其中的大部分,但我仍然有一些是也有点混乱:

Undefined symbols for architecture x86_64:
  "_compress", referenced from:
      _bfd_compress_section_contents in libbfd.a(compress.o)
     (maybe you meant: __bfd_pex64_print_ce_compressed_pdata, __bfd_pep_print_ce_compressed_pdata , _bfd_init_section_compress_status , _bfd_is_section_compressed , _bfd_is_section_compressed_with_header , __bfd_pe_print_ce_compressed_pdata , _bfd_compress_section , _bfd_get_compression_header_size , _bfd_update_compression_header , _bfd_check_compression_header )
  "_compressBound", referenced from:
      _bfd_compress_section_contents in libbfd.a(compress.o)
  "_inflate", referenced from:
      _decompress_contents in libbfd.a(compress.o)
  "_inflateEnd", referenced from:
      _decompress_contents in libbfd.a(compress.o)
  "_inflateInit_", referenced from:
      _decompress_contents in libbfd.a(compress.o)
  "_inflateReset", referenced from:
      _decompress_contents in libbfd.a(compress.o)
4

1 回答 1

0

这些符号来自libz图书馆。

在许多平台上,您不需要显式链接libz,但在 Homebrew 上您需要。

您需要使用-libz.

于 2022-01-01T17:18:28.787 回答