Skip to contentSkip to conversation

can't include headers

DISCUSSION [email protected] 2 participants 2 messages May 29, 2002 – May 30, 2002

lore
Share & tools
lore
#0 lore raw

hi,
I need to write a device driver under linux. I am using slackware linux kernel 2.4.18. I have problem to include headers, here is some of my code:

#define __KERNEL__
#include <linux/config.h> (ok)

#ifdef CONFIG_MODVERSIONS
#define MODVERSIONS
#include <linux/modversions.h> (ok)
#endif

#include <linux/module.h>      (ok)
#include <linux/stddef.h>      (ok) 
#include <linux/kernel.h>      (ok)               
#include <linux/mm.h>          <--- can't include this one

Any comments is greatly appreciated.
Thanks alot.

Ganda

__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

#1 lore raw
Quoted 11 lines · [email protected] said:

I need to write a device driver under linux. I am using slackware linux kernel 2.4.18. I have problem to include headers, here is some of my code:

#define __KERNEL__
#include <linux/config.h> (ok)

#ifdef CONFIG_MODVERSIONS
#define MODVERSIONS
#include <linux/modversions.h> (ok)
#endif

No, this is not OK. Add a simple Makefile like the normal kernel ones and do something like
make -C /lib/modules/uname -r/build SUBDIRS=pwd

It's the only way to get the correct gcc options &c.

--
dwmw2