Re: compiling errors

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

 



Hi!

On 20:07 Wed 28 Jan     , Venkatesh Rao 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

...

You cannot compile your module this way. You need to add the kernel include
path, tell gcc to *not* include the standard c lib and some other stuff. You
can
- put your module in the kernel source tree and add your file to the "Makefile"
  and maybe "Kconfig"
- or try do do what Documentation/kbuild/modules.txt says
	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
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