LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   linux/compiler.h: No such file or directory (https://www.linuxquestions.org/questions/linux-software-2/linux-compiler-h-no-such-file-or-directory-909446/)

roMoon 10-21-2011 08:15 PM

linux/compiler.h: No such file or directory
 
I came to this problem while making:

$make install
cc -c -O -Wall ezusb.c -o ezusb.o
ezusb.c:33:30: fatal error: linux/compiler.h: No such file or directory
compilation terminated.

I did not find compiler.h in /usr/include/linux/.

Highly appreciate any suggestion THANK U SO MUCH!

replica9000 10-21-2011 08:31 PM

You've haven't really provided much info, but I guess first thing I'd suggest is making sure your kernel headers are installed, then check that you have the correct development packages installed too.

gary185 10-21-2011 10:10 PM

my /usr/include/linux has a compiler.h
it's most likely a kernel version thing
make a backup then edit the file that has
#include <linux/compiler.h>
and take it out
it might be at the top of the c file you are working on ezusb.c or in a .h file included in ezusb.c

knudfl 10-22-2011 12:51 AM

"ezusb.c" is the source for the kernel module 'ezusb.ko'.

Please use a "Module build Makefile" :
Will look for, and find the headers in /usr/src/linux/include/***

Makefile :
Code:

obj-m    := ezusb.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

Type make, and these files are created : ezusb.ko ezusb.mod.c
ezusb.mod.o ezusb.o modules.order Module.symvers

.


All times are GMT -5. The time now is 11:35 AM.