我在拱门上,犯了升级错误。
在构建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
我通过将
lbdf
作为g++的参数来同时链接ldl
和-lbfd -ldl
。在按照文档包括 header 之前,我也在做#define BACKWARD_HAS_BFD 1
。我很茫然。
最佳答案
binutils的相应宏略有变化。
您必须从部分宏中删除_get
并手动删除fobj.handle.get()
参数:bfd_get_section_flags(fobj.handle.get(), section)
到bfd_section_flags(section)
。