gpt4 book ai didi

c - 我已经在centos上安装了kernel-devel,还是找不到内核头文件

转载 作者:太空宇宙 更新时间:2023-11-04 10:23:14 26 4
gpt4 key购买 nike

我已经在centos上安装了kernel-devel,还是找不到内核头文件

# yum install kernel-devel
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors....net
* extras: ...
* updates: mirrors.....net
Package kernel-devel-2.6.32-642.15.1.el6.x86_64 already installed and latest version

但是gcc还是找不到头文件:

# cat testkmem.c
#include<sys/types.h>
#include<sys/kmem.h>
int main(){

return 0;
}

# gcc testkmem.c
testkmem.c:2:21: error: sys/kmem.h: No such file or directory

如何解决这个编译问题,是否需要任何额外的 yum 包?

最佳答案

你知道定位命令吗?

$ locate kmem.h
/usr/src/kernels/3.10.0-514.10.2.el7.x86_64/include/config/memcg/kmem.h
/usr/src/kernels/3.10.0-514.10.2.el7.x86_64/include/trace/events/kmem.h

:-),我认为您的PATH 有错误。

关于c - 我已经在centos上安装了kernel-devel,还是找不到内核头文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42921348/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com