i have a problem on my kali linux - i wanted to write a simple program which included 3 header files:
#include <linux/input.h>
#include <stdio.h>
#include <fcntl.h>
i tried to compile it with gcc (default compilation settings) and then i got a whole bunch of errors one after another, e.g.
/usr/include/linux/cache.h:5:10: fatal error: uapi/linux/kernel.h: No such file or directory
5 | #include <uapi/linux/kernel.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
then i tried to locate the uapi/linux/ directory and copy it to /usr/include so compiler can find it, but then
/usr/include/linux/cache.h:5:10: fatal error: uapi/linux/kernel.h: No such file or directory
5 | #include <uapi/linux/kernel.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
after several tries of copying directories to /usr/include i finally get error that says type names of "u32", "u16" are unknown (they are for sure defined in some headers). i don't want to mess with my header files on my own because it doesn't work, so what should i do to compile theese headers?
-I/usr/src/linux-headers-5.10.0-3-common/includebut replace 5.10.0-3 with your kernel version.