Re: ERROR : kernel module verison mismatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/11/05, Chintan Parekh <chintan_embedded@xxxxxxxxx> wrote:
>  
> Hi 
> Friends 
>   
> I m new to the kernel module programming. I m referring to "Linux kernel
> module programming" book availlable on tldp.org. I m using kernel version
> 2.4.20-8. (redhat 9) 
>   
> I wrote a hello world program and it gets compiled successfully, i m using
> the following command. 
>   
> $gcc - c -W -Wstrcik-prototypes -Wmissing-prototypes -isystem
> /lib/modules/2.4.20/'uname -r'/bulid/include  -O2 -DMODULE
> -D__KERNEL__${WARN} ${INCUDE} hello.c 
>   
> the program gets compiled without any error, 
>   
> but when i use the insmod i get the following error 
>   
> command: $ insomod ./hello.o 
> error: 
> ./hello.o: kernel -module verison mismatch 
>              ./hello.o was compiled for kernel version 2.4.20 
>              while this kernel is version 2.4..20.-8 
>   
>   

I think your prob is in the gcc command where you are mentioning the
include directory like this /lib/modules/2.4.20/"uname
-r"/build/include  but that must be like /lib/modules/"uname
-r"/build/include b/c I never found 2.4.20 directory in /lib/modules/
rather found 2.4.20-8 directory ...
 
You can also give include path like /usr/src/linux-2.4/include 

The above thing will work, if you are using default
(un-altered/not-recompiled) kernel


-- 
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux