Re: problem compiling some code

Matti Aarnio (matti.aarnio@zmailer.org)
Sun, 29 Jul 2001 23:51:37 +0300


On Sun, Jul 29, 2001 at 10:56:54PM +0300, Stanciu Adrian wrote:
> PROBLEM: #include errors

This should be FAQ...

> Hello,
>
> I'm trying to compile the following code:
>
> // test.c begins here
> #include <linux/modversions.h>
> #include <linux/module.h>
> #include <linux/version.h>
> #include <linux/kernel.h>
> #include <linux/pci.h>
> #include <linux/delay.h>
> #include <asm/uaccess.h>
>
> void main(void)
> {
> // no further code needed
> }
> // end of test.c
>
> But I get the following errors and warning messages:
....
> The program is compiled using: gcc -Wall test.c

If you are compiling kernel modules (I presume you are),
observing that kernel compiles everything with -D:s of:
-D__KERNEL__
-DMODULE
depending of few things, usually also with:
-DMODVERSIONS

should give you a clue...

> 10x

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