向后的 cpp 无法再构建,尽管链接但缺少 lbdf

Backward cpp can no longer build, missing lbdf despite linking

我在 arch 上,犯了升级的错误。

之前我可以构建 bacward-cpp,现在我收到以下错误:

../libraries/backward-cpp/backward.hpp:1357:10: error: ‘bfd_get_section_flags’ was not declared in this scope; did you mean ‘bfd_set_section_flags’?
 1357 |     if ((bfd_get_section_flags(fobj.handle.get(), section) & SEC_ALLOC) == 0)
      |          ^~~~~~~~~~~~~~~~~~~~~
      |          bfd_set_section_flags
../libraries/backward-cpp/backward.hpp:1360:24: error: ‘bfd_get_section_vma’ was not declared in this scope; did you mean ‘bfd_set_section_vma’?
 1360 |     bfd_vma sec_addr = bfd_get_section_vma(fobj.handle.get(), section);
      |                        ^~~~~~~~~~~~~~~~~~~
      |                        bfd_set_section_vma
../libraries/backward-cpp/backward.hpp:1361:26: error: ‘bfd_get_section_size’ was not declared in this scope; did you mean ‘bfd_set_section_size’?
 1361 |     bfd_size_type size = bfd_get_section_size(section);
      |                          ^~~~~~~~~~~~~~~~~~~~
      |                          bfd_set_section_size
make[1]: *** [VulkanEngine.make:233: obj/Debug/VulkanDebugging.o] Error 1
make: *** [Makefile:30: VulkanEngine] Error 2

我正在链接 lbdfldl,方法是将 -lbfd -ldl 作为 g++ 的参数。根据文档,在包含 header 之前,我也在做 #define BACKWARD_HAS_BFD 1

我很茫然

binutils对应的宏略有改动

您必须从节宏中删除 _get 并手动删除 fobj.handle.get() 参数:bfd_get_section_flags(fobj.handle.get(), section)bfd_section_flags(section)