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

标签 c++ compiler-errors libraries stack-trace

我在 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

我通过将 -lbfd -ldl 作为 g++ 的参数来链接 lbdfldl。在按照文档包含 header 之前,我还在执行 #define BACKWARD_HAS_BFD 1

我很茫然。

最佳答案

binutils对应的宏略有变化。

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

关于c++ - 向后的 cpp 无法再构建,尽管链接但仍缺少 lbdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60235928/

相关文章:

c++ - vector<string> 可以容纳多少数据?

c++ - Fscanf 未从文件的最后一行读取预期值 (C/C++)

excel - 如何修复编译错误: expected End Sub?

c - 错误 "' strcpy' 使指针来自整数而不进行强制转换”

java - 外部库如何工作

c++ - 删除函数c++的读取访问冲突异常

c++ - 如何信任声明为 const 的 C++ 函数的行为?

c - Solaris-内部编译器错误: cg_inbuf_emit() missed/messed up relocation

eclipse - 在 Eclipse 上运行简单的 Hadoop 程序

javascript - 库中的 Google Script HTML 表单抛出错误 Uncaught