/proc 컴파일 오류..
[root@localhost test_h]# make
make -C /lib/modules/2.6.12.6/build SUBDIRS=/root/Desktop/test_h modules
make[1]: Entering directory `/usr/src/linux-2.6.12.6'
CC [M] /root/Desktop/test_h/procfs.o
/root/Desktop/test_h/procfs.c:9:1: warning: "MODULE" redefined
:1:1: warning: this is the location of the previous definition
/root/Desktop/test_h/procfs.c:11:1: warning: "__KERNEL__" redefined
:1:1: warning: this is the location of the previous definition
/root/Desktop/test_h/procfs.c:19:31: error: linux/modversions.h: No such file or directory
/root/Desktop/test_h/procfs.c: In function 'init_module':
/root/Desktop/test_h/procfs.c:183: warning: implicit declaration of function 'proc_register_dynamic'
/root/Desktop/test_h/procfs.c: In function 'cleanup_module':
/root/Desktop/test_h/procfs.c:199: warning: implicit declaration of function 'proc_unregister'
make[2]: *** [/root/Desktop/test_h/procfs.o] Error 1
make[1]: *** [_module_/root/Desktop/test_h] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12.6'
make: *** [default] Error 2
------------------------------------------------
makefile은
obj-m := procfs.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
# fake object
clean:
rm -rf *.o
소스는 ㅡtldp.org procfs.c 입니다.
도와주세요. 역시 처음이라서 이것저것 모르겠는거 투성이네요.
댓글 달기