调用虚拟内存编译时的error处理

来源:互联网 发布:电脑控制手机屏幕软件 编辑:程序博客网 时间:2024/06/05 03:04
以下两行代码在内核编译时报错。
pgd_t *pgd;
pgd = pgd_offset(current->mm, vaddr);


error如下:
error: implicit declaration of function ‘pgd_offset’
error: dereferencing pointer to incomplete type


错误解决方法:
pgd_offset宏定义报错,error: implicit declaration of function ‘pgd_offset’。
需要包含#include <asm/pgtable.h>头文件可以解决该问题。


current->mm行代码报错,error: dereferencing pointer to incomplete type。
需要包含#include <linux/sched.h>头文件可以解决该问题。
1 0
原创粉丝点击