View Full Version : [ubuntu] pthread.h: No such file or directory

June 9th, 2011, 04:10 PM
Need driver build help!! I have a driver that built successfully for Ubunutu 10.04.2 version 2.6.32. I upgraded to Ubuntu 11.04 and version 2.6.38, and now the driver will not build. I use some functions from pthread.h for interrupt support but now that include file cannot be found. If I move it and other required include files to the kernel include directory, the include files are now seen but this causes other errors with predefined values. The Makefile I use is here:

MAJOR = 110

ifneq ($(KERNELRELEASE),) # called by kbuild
obj-m := uio48.o
else # called from command line
KERNEL_VERSION = `uname -r`
KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build
PWD := $(shell pwd)
MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/gpio/

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
uio48io.o: uio48io.c uio48.h Makefile
gcc -c $(EXTRA_CFLAGS) uio48io.c

all: default install poll flash

rm -f $(MODULE_INSTALLDIR)uio48.ko
install -c -m 0644 uio48.ko $(MODULE_INSTALLDIR)
/sbin/depmod -a

rm -f $(MODULE_INSTALLDIR)uio48.ko
/sbin/depmod -a

flash: flash.c uio48.h uio48io.o Makefile
gcc $(EXTRA_CFLAGS) -static flash.c uio48io.o -o flash
chmod a+x flash

poll: poll.c uio48.h uio48io.o Makefile
gcc $(EXTRA_CFLAGS) -D_REENTRANT -static poll.c uio48io.o -o poll -lpthread
chmod a+x poll

rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions /dev/uio48?

rm -rf ioctl poll flash Module.* *.o *~ core .depend .*.cmd *.ko *.mod.c *.order .tmp_versions /dev/uio48?

Has the diver build process changed? I cannot find anything that says it has. I know this is probably an easy problem but I cannot figure it out. I added -I/usr/include to the $(MAKE) command line but it didn't help either.

Please help!!