elfutils 编译错误隐式函数声明
elfutils compilation error implicit-function-declaration
我下载了elfutils 0.170和0.169,但由于隐式函数声明而无法使用gcc编译它们中的任何一个。我在 elfutils makefile 中找不到任何指定 -Werror 或 -Werror=implicit-function-declaration 的地方。 有什么想法可以修复这个编译错误吗?
https://sourceware.org/elfutils/ftp/0.170/我的步骤
1: bzip2 -d elfutils-0.170.tar.bz22:焦油-xvf 精灵-0.170.tar3: ./配置
4:制作
然后出现以下错误。elf_compress_gnu.c:在函数"elf_compress_gnu"中:elf_compress_gnu.c:114:28:错误:函数'htobe64'的隐式声明[-Werror=隐式函数声明] uint64_t be64_size = htobe64 (orig_size(; ^elf_compress_gnu.c:163:15:错误:函数"be64toh"的隐式声明 [-Werror=隐式函数声明] gsize = be64toh (gsize(; ^CC1:所有警告都被视为错误
elfutils错误地使用了htobe64
,它不在任何标准中,仅在glibc和BSD的一个子集中可用。
由于您使用GCC,因此可以使用Ulf Hermann的补丁来解决此问题:
- 将替换 endian.h 和 byteswap.h 添加到 libgnu
它添加了基于 GCC 内置函数的htobe64
实现,因此当 GCC 用作编译器时,它可用,独立于 C 库提供的内容。
- Visual Studio中的函数声明和函数定义问题
- 为什么函数声明中允许 const?
- 如果 x.h 仅由函数声明组成,为什么有必要在 x 中包含 x.h.cpp
- * 和 ** 在 C++ 函数声明中是什么意思?
- 构造函数/函数声明参数列表中的统一初始化
- 在将函数声明为友元时,尖括号的含义是什么?
- 为什么转换函数声明不需要至少一个定义类型说明符
- 如何正确编写指针函数声明?
- 在"template"和函数声明之间使用:template<typename trait> using tr = base_trait<trait> void fn(tr::t
- 为什么要将函数声明和定义放在单独的文件中
- 为什么系统日志有两个不同的函数声明?
- 我如何获取数组的大小,以便我可以从函数声明所述数组
- 使用 enable_if 在按值传递与按引用传递之间更改函数声明
- JavaScript 中的一等函数和 C++ 中的函数声明
- C++ 通过函数声明后初始化向量
- VS2017 #error: : snprintf 的宏定义与标准库函数声明冲突
- C++ 17 个友元函数声明和内联命名空间
- MSVC 2017 - 错误 - 如何将模板类 X 的模板成员函数声明为嵌套类 X::Y 的好友
- 将派生类的构造函数声明为父类的友元
- 用于从 ANSI 字符串转换为 std::basic_string <TCHAR>的正确函数声明