Re: Problems compiling kernel modules

From: Sam Ravnborg
Date: Sat Aug 21 2004 - 14:45:14 EST


On Sat, Aug 21, 2004 at 03:24:12PM -0400, Lei Yang wrote:
> Hi all,
>
> I was trying to compile a kernel module with kbuild. The module 'test.c'
> include a header file 'fred.h' and there is a "#include <stdio.h>" in
> 'fred.h'.
>
> Makefile looks like:
>
> ------------------------------------------------------------------------
> ifneq ($(KERNELRELEASE),)
> obj-m := test.o
>
> else
> KDIR := /usr/src/linux
> PWD := $(shell pwd)
>
> default:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
>
>
> clean:
For 2.6.7 (or 2.6.6) you do not need to specify your own clean: rule.

> But upon compiling, there would be errors like this:
> In file included from /home/lei/test.c:49:
> /home/lei/fred.h:4:19: stdio.h: No such file or directory
The kernel does not provide you with a stdio.h header, so therefore you
cannot find it neither use functionality from it.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/