红联Linux门户
Linux帮助

编译驱动时提示implicit declaration of function

发布时间:2012-06-12 09:05:28来源:红联作者:lin772662623
[i=s] 本帖最后由 lin772662623 于 2012-6-12 09:07 编辑 [/i]

我用的内核是linux-2.6.38
Makefile文件如下:
1 ARCH = arm
2 CROSS_COMPILE = arm-linux-
3
4 obj-m := dht11.o
5 KDIR := /opt/FriendlyARM/tiny6410/linux/linux-2.6.38
6 PWD := $(shell pwd)
7 modules:
8 $(MAKE) -C $(KDIR) M=$(PWD) modules
9 clean:
10 $(MAKE) -C $(KDIR) M=$(PWD) clean

包含的头文件有:
1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 #include
15 #include
16 #include
17 #include
18 #include
19 #include
20 #include
21 #include
22 #include
23 #include
24 #include


编译的时候出错提示:
make -C /opt/FriendlyARM/tiny6410/linux/linux-2.6.38 M=/opt/FriendlyARM/tiny6410/linux/mydrv/drive modules
make[1]: Entering directory `/opt/FriendlyARM/tiny6410/linux/linux-2.6.38'
CC [M] /opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.o
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c: In function 'DHT11_read_byte':
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:39:3: error: implicit declaration of function 's3c2410_gpio_getpin'
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:39:3: error: implicit declaration of function 'S3C2410_GPF'
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c: In function 'DHT11_read':
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:78:2: error: implicit declaration of function 's3c2410_gpio_cfgpin'
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:78:41: error: 'S3C2410_GPIO_OUTPUT' undeclared (first use in this function)
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:78:41: note: each undeclared identifier is reported only once for each function it appears in
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:79:2: error: implicit declaration of function 's3c2410_gpio_setpin'
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:84:41: error: 'S3C2410_GPIO_INPUT' undeclared (first use in this function)
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c: In function 'DHT11_init_module':
/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.c:164:41: error: 'S3C2410_GPIO_OUTPUT' undeclared (first use in this function)
make[2]: *** [/opt/FriendlyARM/tiny6410/linux/mydrv/drive/dht11.o] Error 1
make[1]: *** [_module_/opt/FriendlyARM/tiny6410/linux/mydrv/drive] Error 2

请问下怎么解决这问题呢?
文章评论

共有 2 条评论

  1. lin772662623 于 2012-06-12 12:59:59发表:

    {:3_119:}没人会吗。我是不是发错地方了。

  2. lin772662623 于 2012-06-12 09:07:55发表:

    坐等高手啊。。。{:3_118:}