c - 如何获取 <linux/bootmem.h> 文件并修复错误 "fatal error: linux/bootmem.h: No such file or directory #include <linux/bootmem.h>"?

标签 c linux linux-kernel

我将运行一个使用 #include <linux/bootmem.h> 的代码在代码中。当我在 Linux 中运行代码时,出现错误

“fatal error: linux/bootmem.h: No such file or directory
 #include <linux/bootmem.h>”

我怎样才能找到那个文件?我搜索了一下,没找到。

如果找到该文件,我该如何使用它?将文件放在同一目录中是否足够?

最佳答案

this你在找什么?如果是这样,你可以将它保存在一个头文件中,比如 bootmem.h 并将它与你的源代码放在一起。然后使用以下预处理器指令:

#include "bootmem.h"

当您从系统库中包含头文件时,您使用“< >”括号,当您从本地文件夹中包含头文件时,您应该使用双引号。

关于c - 如何获取 <linux/bootmem.h> 文件并修复错误 "fatal error: linux/bootmem.h: No such file or directory #include <linux/bootmem.h>"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57828819/

相关文章:

linux - 使用 e1000e 网络驱动程序而不是 tg3

unix - 编写系统调用并阻塞进程

c++ - 如何使用堆栈 c 评估算术表达式?

linux - 如何设置在 Linux 机器上运行的服务要使用的环境变量

c - 如何将 NAPI 轮询函数卸载到工作队列

linux - AWK 字符串按字母顺序比较

linux - 如何配置 NMAP 还返回启用了 SIP 端口的设备名称?

c - 如何为 const 结构指针的变量赋值?

c - 信号处理程序终止程序

c - 蓝牙 LE L2CAP CID 与 PSM