Score:0

Kernel file missing

pk flag

I am using Ubuntu 20.04 with the kernel version 5.13.0-27-generic and when I try to compile the code

#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>

int
main(void) {
    return 0;
}

using the command

g++ main.cpp -o example

the compiler output is

In file included from /usr/include/linux/ktime.h:25,
                 from /usr/include/linux/timer.h:6,
                 from /usr/include/linux/workqueue.h:9,
                 from /usr/include/linux/rhashtable-types.h:15,
                 from /usr/include/linux/ipc.h:7,
                 from /usr/include/uapi/linux/sem.h:5,
                 from /usr/include/linux/sem.h:5,
                 from /usr/include/linux/sched.h:15,
                 from /usr/include/linux/hardirq.h:9,
                 from /usr/include/linux/interrupt.h:11,
                 from gpiointerruptpp/main.cpp:10:
/usr/include/linux/jiffies.h:14:10: fatal error: generated/timeconst.h: No such file or directory

It seems as some kernel modules/files are missing. Can anyone help me with this?

Regards,

s0n1c

hr flag
Have you actually installed the kernel headers package (`linux-headers-generic`)?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.