Re: compiling errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 28, 2009 at 9:37 PM, Venkatesh Rao <venkateshnrao@xxxxxxxxx> wrote:
> i am trying to write a simple device driver
>
> filename:dd.c
>
>
> #include <module.h>
> #include<kernel.h>
> #include<mod_devicetable.h>
> #include<moduleparam.h>
> #include<moduleloader.h>
>
>
> int init_module (void) /* Loads a module in the kernel */
> {
> printk("Hello kernel n");
> return 0;
> }
>
> void cleanup_module(void) /* Removes module from kernel */
> {
> printk("GoodBye Kerneln");
> }
>
>
>
> gcc -c dd.c  gives me the following errors:
>
> In file included from /usr/include/module.h:10,
>                  from dd.c:2:
> /usr/include/linux/cache.h:5:23: error: asm/cache.h: No such file or
> directory
> In file included from dd.c:2:
> /usr/include/module.h:41: error: field 'attr' has incomplete type
> /usr/include/module.h:42: error: expected specifier-qualifier-list before
> 'ssize_t'
> /usr/include/module.h:49: error: field 'kobj' has incomplete type
> /usr/include/module.h: In function 'search_module_extables':
> /usr/include/module.h:433: error: 'NULL' undeclared (first use in this
> function)
> /usr/include/module.h:433: error: (Each undeclared identifier is reported
> only once
> /usr/include/module.h:433: error: for each function it appears in.)
> /usr/include/module.h: In function 'module_text_address':
> /usr/include/module.h:439: error: 'NULL' undeclared (first use in this
> function)
> /usr/include/module.h: In function '__module_text_address':
> /usr/include/module.h:445: error: 'NULL' undeclared (first use in this
> function)
> /usr/include/module.h: In function 'module_address_lookup':
> /usr/include/module.h:476: error: 'NULL' undeclared (first use in this
> function)
> /usr/include/module.h: In function 'module_get_kallsym':
> /usr/include/module.h:484: error: 'NULL' undeclared (first use in this
> function)
> In file included from dd.c:6:
> /usr/include/moduleloader.h: At top level:
> /usr/include/moduleloader.h:11: error: expected ')' before '*' token
> /usr/include/moduleloader.h:25: error: expected ')' before '*' token
> /usr/include/moduleloader.h:33: error: expected ')' before '*' token
> /usr/include/moduleloader.h:40: error: expected ';', ',' or ')' before '*'
> token
>
>
> i am using 2.6.18-8.el5 red hat enterprise linux 5
>
> kindly guide me
>

just calling gcc is not sufficient. refer to
http://tldp.org/LDP/lkmpg/2.6/html/x181.html

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux