Re: Missing header files

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

 



Hello!

Dne sobota 30. november 2002 13:24 je Jose Luis Alarcon napisal(a):

>   I am in a situation very similar to Paridhi. In my module try, the
> compilator don't find headers out of /usr/src/include but it can't find all
> headers it seems need, and i can't understand why.

Kernel code AFAIK isn't supposed to include headers from /usr/include.

> gcc -Wall -c -I/usr/src/linux/include -DKBUILD_MODNAME=Module_dma
> Module_dma.c

Why don't you try:
--------------------
cc -D__KERNEL__ -DMODULE -I/usr/src/linux/include -O2 -Wall -DDEBUG   -c -o \
module.o module.c

This is a piece of my Makefile:
----------------------------------
KERNELDIR = /usr/src/linux
KERN_INC = $(KERNELDIR)/include
VERSIONFILE = $(KERN_INC)/linux/version.h
VERSION = $(shell awk -F\" '/REL/ {print $$2}' $(VERSIONFILE))
INSTALLDIR = /lib/modules/$(VERSION)/misc

include $(KERNELDIR)/.config

CFLAGS = -D__KERNEL__ -DMODULE -I$(KERN_INC) -O2 -Wall -DDEBUG

ifdef CONFIG_SMP
  CFLAGS += -D__SMP__ -DSMP
endif

Have you tried reading "Writing Linux device drivers" from Alessandro and Jon? 
It is opensourced/available on the internet for download. I found this book 
to be a *really* _great_ source of information.

-- 
best regards,
Rok Papež.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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