I'm currently having a problem when trying to compile a linux kernel module, the stdio.h and other files are not found. However when compiling a general helloworld.c file with gcc these are found correctly and they are in the /usr/include folder where they belong. However when I run my makefile they aren't found. I've tried two different types of makefile, the first:
In the second makefile i've changed the /lib/modules/ part with the location of my kernel src: /usr/src/linux-126.96.36.199 these can't find the normal header include files:
koen@mvision:~/SoftEmb/practicum/driver$ cat Makefile
obj-m += driver.o
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
I even tried to include the folder with the -I option, but this has no result. I've run these make file as root and as user but this doesn't make any difference.
koen@mvision:~/SoftEmb/practicum/driver$ make -I/usr/include
make -C /lib/modules/188.8.131.52/build M=/home/koen/SoftEmb/practicum/driver modules
make: Entering directory `/usr/src/linux-184.108.40.206'
CC [M] /home/koen/SoftEmb/practicum/driver/driver.o
In file included from /home/koen/SoftEmb/practicum/driver/driver.c:10:
/home/koen/SoftEmb/practicum/driver/driver.h:5:19: error: stdio.h: No such file or directory
/home/koen/SoftEmb/practicum/driver/driver.h:6:19: error: fcntl.h: No such file or directory
/home/koen/SoftEmb/practicum/driver/driver.h:7:20: error: unistd.h: No such file or directory
/home/koen/SoftEmb/practicum/driver/driver.h:8:20: error: signal.h: No such file or directory
/home/koen/SoftEmb/practicum/driver/driver.h:9:22: error: sys/stat.h: No such file or directory
/home/koen/SoftEmb/practicum/driver/driver.h:10:23: error: sys/types.h: No such file or directory
/home/koen/SoftEmb/practicum/driver/driver.h:11:38: error: sys/ioctl.h: No such file or directory
Can anyone help me?