Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Linux
|
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2006, 02:24 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default linux kernel compilation problem

i have compile a module for linux . i have red-hat linux 2.4.20-8 somewhat like this version kernel. and when i compile that module for
linux, the module version is 2.4.20 only so when i insert the module it
gives the error version of module is differt from the kernel version .
so can anybody tell me how i could compile that module so that its version is similar to my kernel version as i compile that module on my
kernel version 2.4.20-8 but module is compiled with differnt version.

 
Old May 23rd, 2006, 04:55 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

after you make your kernel do
make modules

HTH

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
 
Old June 5th, 2006, 05:03 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

z
Quote:
quote:Originally posted by ciderpunx
 after you make your kernel do
make modules

HTH
--
Don't Stand on your head - you'll get footprints in your hair
                                         http://charlieharvey.org.uk
                                             http://charlieharvey.com
i have not make the kernel . the kernel is of red -hat
i have only make the module but the version in which it is compiled is not same as the kernel version


 
Old June 19th, 2006, 06:27 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Quote:
quote:Originally posted by abhishekshrivastav
 z
Quote:
quote:Originally posted by ciderpunx
Quote:
 after you make your kernel do
make modules

HTH
--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
i have not make the kernel . the kernel is of red -hat
i have only make the module but the version in which it is compiled is not same as the kernel version


Ah OK,

Then you'll want to install the module for the same version of the kernel that you're running. You should be able to download it from the kernel archive:

http://kernel.org/

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
 
Old October 13th, 2006, 06:47 AM
Registered User
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shyjumon.n
Default

 Hi, new here, and having trouble with hello-1.c compliling.
I am using Fedora Core 4 (2.6.11 kernel version), and here is my hello-1.c
/*
 * hello#8722;1.c #8722; The simplest kernel module
 */
#define KERN_INFO
        module_LICENSE("GPL"); //also tried MODULE_LINCENSE("GPL");

#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
int init_module(void)
{
        printk(KERN_INFO "Hello world 1.\n");
        /*
         * A non 0 return means init_module failed; module can't be loaded.
         */
        return 0;
}
void cleanup_module(void)
{
        printk(KERN_INFO "Goodbye world 1.\n");
}
 here is my make file
CFLAGS = -D __KERNEL__ -D MODULE -isystem /lib/modules/`uname -r`/build/include/
$ hello-1.o: hello-1.c
        gcc $(CFLAGS) -O2 -Wall -c hello-1.c
.PHONY: clean
clean:
        rm -rf *.o a.out

gcc -D __KERNEL__ -D MODULE -isystem /lib/modules/`uname -r`/build/include/ -O2 -Wall -c hello-1.c
hello-1.c:5: error: syntax error before string constant
hello-1.c:5: warning: type defaults to ‘int’ in declaration of ‘module_LICENSE’
hello-1.c:5: warning: data definition has no type or storage class
In file included from /usr/include/linux/module.h:10,
                 from hello-1.c:7:
/usr/include/linux/config.h:5:2: error: #error Incorrectly using glibc headers for a kernel module
hello-1.c: In function ‘init_module’:
hello-1.c:11: warning: implicit declaration of function ‘printk’
make: *** [hello-1.o] Error 1

Here is the output from the screen.

Thanks for the help.


smn





Similar Threads
Thread Thread Starter Forum Replies Last Post
compilation error on linux GIGI BOOK: Ivor Horton's Beginning Visual C++ 2005 1 November 5th, 2007 12:37 PM
DLL registration/compilation problem DarrenMelling Pro VB 6 0 October 12th, 2007 02:35 AM
Kernel compilation probelm shyjumon.n Linux 1 October 24th, 2006 07:49 AM
JSP Compilation Problem devteam JSP Basics 1 January 13th, 2006 02:13 PM
Linux kernel configuration to include SCSI drivers manitu Linux 0 August 9th, 2005 11:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.