Dear All,

I want to run this program (simple program related to device driver):

#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");

Compiling the module

# gcc -c hello.c
# insmod hello.o

The output is

Hello kernel

The procedure is going right upto compiling the program, but when i am trying to run "insmod hello.o", it give me an error as:

hello.o: kernel-module version mismatch
hello.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.20-8.

It mean the gcc i am using for compile the program is different from the current kernel version, but to change the gcc to the current kernel where should i look in the Linux? what could be the method to get to the right gcc of the current kernel version?\

Nishant Desai