error in module compiling

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

 



Hi all,
I've created a simple module (the source code is listed below) and I've 
compiled it by using 'gcc -c hello-1.c' command . 
There's no compiling errors but when I type the command 'insmod ./hello-1.o' 
the system return the error:
'./hello-1.o: couldn't find the kernel version the module was compiled for'.
What does it mean?
Thanks.
Vincenzo.

P.S. My system is a Slackware 10 with linux 2.4.26.


-----------------------hello-1.c-----------------------

#define __KERNEL__
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

int init_module(void)
{
  printk(KERN_DEBUG "Hello World\n");

  return 0;
}

void cleanup_module(void)
{
  printk(KERN_DEBUG "Bye World\n");

  return;
}

--
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