LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-27-2005, 01:47 PM   #1
pele21
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
problem with compiling a simple module


hello everybod, i wanted to compile a simple module on my suse box 9.0 kernel 2.4.21-99, but it did nott work.

I don't know what's the problem(quite a newby), I looked in several forum for similar threads but nobody could answer my question.

this is the module example:
#define MODULE
#include <linux/module.h>

int init_module(void) { printk("<1>Hallo, Welt\n"); return 0; }
void cleanup_module(void) { printk("<1>Ade, du grausame Welt\n"); }


and when I compile it with
gcc -c hello.c i get the following:
Z626:/home/igor # gcc -c hello.c
In file included from /usr/include/linux/sched.h:12,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/jiffies.h:16: error: parse error before "jiffies_64"
/usr/include/linux/jiffies.h:20: error: parse error before
"get_jiffies_64"
In file included from /usr/include/linux/sched.h:20,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/asm/mmu.h:13: error: field `sem' has incomplete type
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:24,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/list.h:563:2: Warnung: #warning "don't include kernel
headers in userspace"
In file included from /usr/include/asm/siginfo.h:4,
from /usr/include/linux/signal.h:7,
from /usr/include/linux/sched.h:24,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/asm-generic/siginfo.h:49: error: size of array `_pad' is too
large
In file included from /usr/include/linux/sched.h:26,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/fs_struct.h:9: error: parse error before "rwlock_t"
/usr/include/linux/fs_struct.h:13: error: parse error before '}' token
In file included from /usr/include/linux/sched.h:28,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/completion.h:15: error: parse error before
"wait_queue_head_t"
/usr/include/linux/completion.h: In function `init_completion':
/usr/include/linux/completion.h:26: error: dereferencing pointer to
incomplete type
/usr/include/linux/completion.h:27: error: dereferencing pointer to
incomplete type
In file included from /usr/include/linux/sched.h:29,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/pid.h: At top level:
/usr/include/linux/pid.h:18: error: field `task_list' has incomplete type
/usr/include/linux/pid.h:19: error: field `hash_chain' has incomplete type
/usr/include/linux/pid.h:24: error: field `pid_chain' has incomplete type
In file included from /usr/include/linux/sched.h:30,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/percpu.h: In function `__alloc_percpu':
/usr/include/linux/percpu.h:46: error: `GFP_KERNEL' undeclared (first use
in this function)
/usr/include/linux/percpu.h:46: error: (Each undeclared identifier is
reported only once
/usr/include/linux/percpu.h:46: error: for each function it appears in.)
In file included from /usr/include/linux/sched.h:101,
from /usr/include/linux/module.h:9,
from hello.c:3:
/usr/include/linux/timer.h: At top level:
/usr/include/linux/timer.h:10: error: field `entry' has incomplete typ


Please help me!!!
i would apreciate every kind of help

thank you
 
Old 04-27-2005, 01:57 PM   #2
madluther
Member
 
Registered: Aug 2004
Distribution: LFS
Posts: 350

Rep: Reputation: 31
This http://www.tldp.org/LDP/lkmpg/ should get you headed in the right direction

Mad
 
Old 04-28-2005, 02:29 AM   #3
pele21
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Original Poster
Rep: Reputation: 0
problem with compiling simple module

thank you very much
 
  


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
Simple Linux Kernel Module Problem for 2.4.31 KneeLess Programming 3 08-19-2005 09:59 PM
Problem adding a simple kernel module in 2.6 palbox2003 Linux - Software 2 07-14-2004 03:23 AM
Problem adding a simple module to 2.6 palbox2003 Linux - Newbie 2 07-14-2004 03:22 AM
Problem with compiling module under slackware Altos Programming 0 02-22-2003 12:46 PM
Problem compiling demonstration module using 2.4.18 johnvoisey Linux - Software 1 06-14-2002 03:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:59 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