Chinaunix首页 | 论坛 | 博客
  • 博客访问: 737246
  • 博文数量: 66
  • 博客积分: 2418
  • 博客等级: 大尉
  • 技术积分: 1659
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-28 10:04
个人简介

keep moving

文章分类

全部博文(66)

文章存档

2015年(2)

2014年(6)

2013年(7)

2011年(7)

2010年(42)

2009年(2)

分类: LINUX

2011-09-15 16:50:15

错误:
  1. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_open':
  2. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:54: error: dereferencing pointer to incomplete type
  3. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:54: error: dereferencing pointer to incomplete type
  4. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_release':
  5. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:96: error: dereferencing pointer to incomplete type
  6. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:96: error: dereferencing pointer to incomplete type
  7. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_read':
  8. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:140: error: dereferencing pointer to incomplete type
  9. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:140: error: dereferencing pointer to incomplete type
  10. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_write':
  11. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:210: error: dereferencing pointer to incomplete type
  12. /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:210: error: dereferencing pointer to incomplete type
 
出错语句:
  1. printk(KERN_DEBUG "\"%s(pid %d)\" open scumm device!\n", current->comm, current->pid);
宏current定义在arch/arm/include/asm/current.h中,
  1. static inline struct task_struct *get_current(void)
  2. {
  3.     return current_thread_info()->task;
  4. }

  5. #define current (get_current())
出错原因:
编译器不知道task_struct的具体定义,因此,无法解引用current,无法获知其成员comm、pid的类型,才报“dereferencing pointer to incomplete type”
task_struct定义在中。在源文件头,加上#include ,即可解决问题!
“dereferencing pointer to incomplete type”错误,大多也是因为不知道struct/class/emun/union等的定义而引起的
阅读(18607) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~