I am a newbie to linux kernel/system development.
Below is the Makefile i am using to compile my application
CROSS_COMPILE ?=
KERNEL_DIR ?= /usr/src/linux
CC := $(CROSS_COMPILE)gcc
KERNEL_INCLUDE := -I/usr/include
CFLAGS := -W -Wall -g $(KERNEL_INCLUDE)
LDFLAGS := -g
all: finder-drv
finder-drv: finder.o
$(CC) $(LDFLAGS) -o $@ $^
clean:
rm -f *.o
rm -f finder
I am getting the following the error:
/usr/include/arm-linux-gnueabi/sys/ioctl.h:22:22: fatal error: features.h: No such file or directory
I don’t know why the features.h is missing.
This problem came after i run the following command:
make headers_install INSTALL_HDR_PATH=/usr
Can anyone tell me how to fix the issue and correctly link/use kernel header files in a user-space appliation?
Problem Solved.
The correct command to export kernel headers for user-space application is below
I have given
/usrinstead of/usr/includeI recovered the deleted files in
/usr/includeby reinstalling thelibc-devusing the following commandChris, Thanks for your time and help.