I’ve decided to get my hands dirty and try messing around and create a driver for a device. However, the very first problem I run into is that gcc fails to find the following headers:
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/io.h>
Simply copying and pasting the code from the kernel doc’s “Creating an input driver” (can’t put the link, probably account limiation) immediately gave me a compile error: fatal error: linux/init.h: No such file or directory
I’ve confirmed that the problem is specifically with finding the headers, as a simple hello world fails to compile and, if I comment or exclude those headers, the compiler works. For the sake of comparison, the headers <linux/input.h> <linux/module.h>
don’t generate a compile error.
sudo pacman -Syu
shows that everything is up to date.
I have linux59-headers
and linux-api-headers
installed and the result of uname -r is 5.9.16-1-MANJARO
How can I make the compiler find the headers?