request_irq func. header file?

I try to compile program which use request_irq function declarated in linux/sched.h but it bring a lot of errors relating to include directives in sched.h.
I try on Mandrake7.2 and RedHat7.2 but result same.
A lot of thanks for your answers.

Be more specific. Can you post the details of the error messages? Copy and paste the output if possible.

I am compiling with gcc 2.96, in kdevelop shell.
here is main and output, when I include some header files included in linux/sched.h by hand in main, some errors disappear.

A lot of thanks for your interesting to my question.

main
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <asm/irq.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/interrupt.h>

int main()
{
return 0;
}

//output

make all-recursive
gmake[1]: Entering directory `/home/ghg/camac'
Making all in camac
gmake[2]: Entering directory `/home/ghg/camac/camac'
g++ -DHAVE_CONFIG_H -I. -I. -I.. -O0 -g3 -Wall -c main.cpp
In file included from /usr/include/linux/sched.h:15,
from main.cpp:24:
/usr/include/linux/timex.h:173: field `time' has incomplete type
In file included from /usr/include/linux/sched.h:17,
from main.cpp:24:
/usr/include/asm/system.h:224: parse error before `new'
/usr/include/asm/system.h: In function `long unsigned int __cmpxchg
(...)':
/usr/include/asm/system.h:227: `size' undeclared (first use this
function)
/usr/include/asm/system.h:227: (Each undeclared identifier is reported
only once for each function it appears in.)
/usr/include/asm/system.h:231: parse error before `)'
/usr/include/asm/system.h:237: parse error before `)'
/usr/include/asm/system.h:243: parse error before `)'
/usr/include/asm/system.h:247: `old' undeclared (first use this
function)
In file included from /usr/include/linux/sched.h:80,
from main.cpp:24:
/usr/include/linux/timer.h: At top level:
/usr/include/linux/timer.h:17: field `list' has incomplete type
/usr/include/linux/timer.h: In function `void init_timer (timer_list
*)':
/usr/include/linux/timer.h:47: `struct timer_list' has no member named
`list'
/usr/include/linux/timer.h:47: `struct timer_list' has no member named
`list'
/usr/include/linux/timer.h: In function `int timer_pending (const
timer_list *)':
/usr/include/linux/timer.h:52: `struct timer_list' has no member named
`list'
In file included from /usr/include/asm/hardirq.h:6,
from /usr/include/linux/interrupt.h:45,
from main.cpp:25:
/usr/include/linux/irq.h: At top level:
/usr/include/linux/irq.h:30: parse error before `typename'
In file included from /usr/include/linux/irq.h:59,
from /usr/include/asm/hardirq.h:6,
from /usr/include/linux/interrupt.h:45,
from main.cpp:25:
/usr/include/asm/hw_irq.h:78: parse error before `)'
/usr/include/asm/hw_irq.h: In function `void FASTCALL (...)':
/usr/include/asm/hw_irq.h:193: cannot declare static function inside
another function
/usr/include/asm/hw_irq.h: In function `void x86_do_profile (long
unsigned int)':
/usr/include/asm/hw_irq.h:222: cannot declare static function inside
another function
In file included from /usr/include/asm/hardirq.h:18,
from /usr/include/linux/interrupt.h:45,
from main.cpp:25:
/usr/include/linux/irq_cpustat.h: In function `void hw_resend_irq
(hw_interrupt_type *, unsigned int)':
/usr/include/linux/irq_cpustat.h:20: non-local variable `hw_resend_irq
(hw_interrupt_type *, unsigned int)::irq_cpustat_t irq_stat[]' uses
local type `hw_resend_irq (hw_interrupt_type , unsigned
int)::irq_cpustat_t'
In file included from main.cpp:25:
/usr/include/linux/interrupt.h:75: non-local function `void
open_softirq (int, void (
) (hw_resend_irq (hw_interrupt_type *,
unsigned int)::softirq_action *), void *)' uses local type
`hw_resend_irq (hw_interrupt_type *, unsigned int)::softirq_action'
/usr/include/linux/interrupt.h:78: cannot declare static function
inside another function
/usr/include/linux/interrupt.h: In function `void __cpu_raise_softirq
(int, int)':
/usr/include/linux/interrupt.h:85: cannot declare static function
inside another functigmake[2]: Leaving directory `/home/ghg/camac/camac'
on
/usr/include/linux/interrupt.h: In function `void raise_softirq (int)':
/usr/include/linux/interrupt.h:144: non-local variable `raise_softirq
(int)::tasklet_head tasklet_vec[1]' uses local type `raise_softirq
(int)::tasklet_head'
/usr/include/linux/interrupt.h:145: non-local variable `raise_softirq
(int)::tasklet_head tasklet_hi_vec[1]' uses local type `raise_softirq
(int)::tasklet_head'
/usr/include/linux/interrupt.h:158: cannot declare static function
inside another function
/usr/include/linux/interrupt.h: In function `void tasklet_schedule
(raise_softirq (int)::tasklet_struct *)':
/usr/include/linux/interrupt.h:172: cannot declare static function
inside another function
/usr/include/linux/interrupt.h: In function `void tasklet_hi_schedule
(raise_softirq (int)::tasklet_struct *)':
/usr/include/linux/interrupt.h:187: cannot declare static function
inside another function
/usr/include/linux/interrupt.h: In function `void
tasklet_disable_nosync (raise_softirq (int)::tasklet_struct *)':
/usr/includgmake[1]: Leaving directory `/home/ghg/camac'
e/linux/interrupt.h:192: cannot declare static function
inside another function
/usr/include/linux/interrupt.h: In function `void tasklet_disable
(raise_softirq (int)::tasklet_struct *)':
/usr/include/linux/interrupt.h:198: cannot declare static function
inside another function
/usr/include/linux/interrupt.h: In function `void tasklet_enable
(raise_softirq (int)::tasklet_struct )':
/usr/include/linux/interrupt.h:202: non-local function `void
tasklet_kill (raise_softirq (int)::tasklet_struct )' uses local type
`raise_softirq (int)::tasklet_struct'
/usr/include/linux/interrupt.h:204: non-local function `void
tasklet_init (raise_softirq (int)::tasklet_struct , void () (long
unsigned int), long unsigned int)' uses local type `raise_softirq
(int)::tasklet_struct'
/usr/include/linux/interrupt.h:227: non-local variable `raise_softirq
(int)::tasklet_struct bh_task_vec[]' uses local type `raise_softirq
(int)::tasklet_struct'
/usr/include/linux/interrupt.h:233: cannot declare static function
inside another function
gmake[2]: *** [main.o] Error 1
gmake[1]: *** [all-recursive] Error 1
gmake: *** [all-recursive-am] Error 2
*** failed *