LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2004, 08:42 PM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
compile kernel module got version mismatched?


Have following code

Code:
#include <linux/module.h>
#include <linux/kernel.h>

int init_module()
{
printk("init module\n");

return 0;
}

void cleanup_module()
{
printk("end module\n");

}
Compiled by "gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -O -c cc.c"

run "insmod cc.o" but got error

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

How do I fix it?
 
Old 11-07-2004, 09:41 PM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

which version of kernel do u have in sources
get the kernel sources same as that ur running
and use that header fields in the "include" section

regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to compile a module with a newer version of the linux kernel? fvarela Programming 2 07-29-2004 02:00 AM
Unable to build NVIDIA kernel module / determin kernel version Night Ink Fedora 2 05-31-2004 04:54 PM
grub Error 6:Mismatched o corrupt version of stage1/stage 2 mikmok Linux - General 2 03-02-2004 11:52 AM
Xfree prob radeon.o kernel module version is 1.1.1 but version 1.5.0 or newer needed. jimdaworm Slackware 0 10-01-2003 06:27 PM
Sample Driver Module incompatibility with Kernel version (or gcc version) jvs Linux - General 1 06-07-2002 01:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration