-
module.h
I was trying to compile a program in ubuntu linux, but i wasnt able to find module.h in /usr/include/linux/
Please help me
************************************************** ********
compilation
************************************************** ********
gcc -c hello.c
hello.c:2:26: error: linux/module.h: No such file or directory
************************************************** ****
source
************************************************** ****
Code:
#define MODULE
#include <linux/module.h>
int init_module (void) /* Loads a module in the kernel */
{
printk("Hello kernel n");
return 0;
}
void cleanup_module(void) /* Removes module from kernel */
{
printk("GoodBye Kerneln");
}
************************************************** *******
Thx in advance
-
Maybe you need to include a kernel development kit? Look for a package called linux-headers.
By the way, this is a kernel module, not a program.
-
thx for your help. But can you tell me the package name. apt-get install ******
yes i was trying to compile a module.
-
No, I don't have Ubuntu, so I don't know. linux-headers is what it is called in Gentoo.
Another thing to try: see if /usr/include contains a directory called linux-2.6.xx or kernel-headers-2.6.xx (where xx is the micro version of your kernel). If you find such a thing, make a symlink called linux to it.