Hello, I want to study linux module program using eclipse based on Beagle Bone Black, and I have build the development environment under eclipse(Version: Kepler Service Release 1 Build id: 20130919-0819), but when I build a example (hello world module ),it shows this problem:
Description Resource Path Location Type
fatal error: linux/module.h: 没有那个文件或目录 main.c /module_test1 line 10 C/C++ Problem
here is the source of my main.c
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
MODULE_LICENSE("Dual BSD/GPL");
static char *book_name = "dissecting Linux Device Driver";
static int num = 4000;
static int book_init(void)
{
printk(KERN_INFO " book name:%s\n",book_name);
printk(KERN_INFO " book num:%d\n",num);
return 0;
}
static void book_exit(void)
{
printk(KERN_ALERT " Book module exit\n ");
}
module_init(book_init);
module_exit(book_exit);
module_param(num, int, S_IRUGO);
module_param(book_name, charp, S_IRUGO);
MODULE_AUTHOR("Song Baohua, author@linuxdriver.cn");
MODULE_DESCRIPTION("A simple Module for testing module params");
MODULE_VERSION("V1.0");
before I build I write a makefile myself and here is the makefile content:
ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf-
obj-m := led.o
KDIR :=/home/hcz/am335x/kernel/kernel
PWD :=$(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
here attached my project perspective:
here is the path ,and the module.h is in this path,from above picture, we can see the path has been added to the project, but how does this problem happen, strangely, the kernel.h can be find in this project ,I'm confused with it, can anyone help me?

