Re: problem compiling some code

From: Matti Aarnio (matti.aarnio@zmailer.org)
Date: Sun Jul 29 2001 - 15:51:37 EST


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/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:41 EST