LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 03-13-2004, 11:27 AM   #1
jd20878
LQ Newbie
 
Registered: Aug 2003
Posts: 10

Rep: Reputation: 0
gcc & kernel mismatch


I'm trying to learn about device driver programming by compiling a simple program under gcc. The program compiles fine but when I try to load the module using insmod I get the following error:


/home/jason/driver.o : kernel- module version mismatch
/home/jason/driver.o was compiled for kernel version 2.4.20
while the kernel is version 2.4.20-28.9


How can I fix this problem? Any help woud be greatly appreciated.
 
Old 03-13-2004, 04:33 PM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Well ......you might edit the Makefile and make the driver think it was compiled with kernel 2.4.20-28.9

it is Open Source, so hack away........
 
Old 03-13-2004, 06:00 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Maybe you included the wrong set of kernel-headers?
i.e. gcc -I/usr/src/linux-2.4.20-28.9
 
Old 03-13-2004, 07:12 PM   #4
jd20878
LQ Newbie
 
Registered: Aug 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Hko,

That was the problem. Thanks for your help.
 
Old 03-14-2004, 10:41 AM   #5
jd20878
LQ Newbie
 
Registered: Aug 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Hey 320mb,

You responded to my post about a kernel mismatch. Your suggestion was to edit the makefile. I was able to get around my original problem but am curious as to how I could have done what you suggested. Ho do I edit a makefile. Where is it?

Your help would be appreciated.

Jason
 
  


Reply



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 find Linux kernel & gcc version taichiman Linux - Hardware 4 04-12-2016 09:20 PM
new kernel mismatch with gcc??? JNaas Linux - Newbie 4 10-18-2004 10:59 AM
Kernel mismatch vedion Linux - General 1 03-31-2004 03:48 AM
Mismatch GCC 3.3 pPcG5 Linux - General 1 09-13-2003 01:42 AM
GCC ver. mismatch for NV driver... NSKL Slackware 1 05-14-2003 01:49 PM

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

All times are GMT -5. The time now is 08:00 PM.

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
Open Source Consulting | Domain Registration