You are not logged in.
Pages: 1
Hi guys,
i'll want compile a simple module in Arch but i get the following error:
/home/.../..../Modulo//Modulo.c:1:10: fatal error: linux/init.h : File o directory non esistente
#include < linux/init.h >
^~~~~~~~~~~~~~~~
compilation terminated.
I've already installed linux-headers package. This is my module:
#include < linux/init.h >
#include < linux/module.h >
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void) {
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void) {
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
This is the Makefile:
obj-m := Modulo.o
KDIR := /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
In other distributions work as well
Who helps me? Thanks all
Last edited by archdom (2019-03-24 14:25:22)
Offline
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Offline
i've already installed....but not works!
Offline
Get rid of the spaces between the angled brackets and the file names.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Get rid of the spaces between the angled brackets and the file names.
it works!
how did I not think about it .... I'm really sorry.
thanks a lot
Last edited by archdom (2019-03-24 14:25:56)
Offline
Which is btw. the reason for https://wiki.archlinux.org/index.php/Co … s_and_code (ok, at least one of them)
There's also a sub-zero chance for "In other distributions work as well" …
Offline
There's also a sub-zero chance for "In other distributions work as well" …
I did copy and paste from Ubuntu .... and it worked there too. The problem is that during this procedure the editor has created some empty spaces that made the compilation fail. I didn't think it was sensitive to empty spaces .... I come from other programming languages.
Offline
Pages: 1