当前位置: 技术问答>linux和unix
驱动编译出错,哪位大侠帮忙看看问题出在哪里....
来源: 互联网 发布时间:2016-04-25
本文导语: 由于刚接触Linux开发,对驱动这一块不太熟悉,因此也编编hello world这样的模块来熟悉。 任务就来了,在V4L3L2官方下了一个bttv-0.9.15,放到机器上来编译,却是编译不过去,我怀疑是不是内核版本 这些环境不同引发的...
由于刚接触Linux开发,对驱动这一块不太熟悉,因此也编编hello world这样的模块来熟悉。
任务就来了,在V4L3L2官方下了一个bttv-0.9.15,放到机器上来编译,却是编译不过去,我怀疑是不是内核版本
这些环境不同引发的,所报错误如下:
[code=INIFile]bill@Bill:~/bttv-0.9.15> make -f Makefile.old
make -C /lib/modules/2.6.27.4-pae/build SUBDIRS=/home/bill/bttv-0.9.15 modules
make[1]: Entering directory `/usr/src/linux-2.6.27.4'
CC [M] /home/bill/bttv-0.9.15/bt832.o
/home/bill/bttv-0.9.15/bt832.c:34:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:34:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:34:40: error: missing binary operator before token "("
In file included from /home/bill/bttv-0.9.15/bt832.c:42:
/home/bill/bttv-0.9.15/bttv.h:234:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bttv.h:234:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bttv.h:234:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bttv.h:284:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bttv.h:284:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bttv.h:284:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bttv.h:293:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bttv.h:293:27: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bttv.h:293:41: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c:177:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:177:27: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:177:41: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c:200:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:200:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:200:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c: In function 'bt832_probe':
/home/bill/bttv-0.9.15/bt832.c:217: error: 'I2C_ALGO_BIT' undeclared (first use in this function)
/home/bill/bttv-0.9.15/bt832.c:217: error: (Each undeclared identifier is reported only once
/home/bill/bttv-0.9.15/bt832.c:217: error: for each function it appears in.)
/home/bill/bttv-0.9.15/bt832.c:218: warning: passing argument 3 of 'i2c_probe' from incompatible pointer type
/home/bill/bttv-0.9.15/bt832.c:230:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:230:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:230:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c:263:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:263:27: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:263:41: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c: At top level:
/home/bill/bttv-0.9.15/bt832.c:266: error: unknown field 'name' specified in initializer
/home/bill/bttv-0.9.15/bt832.c:266: warning: initialization makes integer from pointer without a cast
/home/bill/bttv-0.9.15/bt832.c:268: error: unknown field 'flags' specified in initializer
/home/bill/bttv-0.9.15/bt832.c:268: error: 'I2C_DF_NOTIFY' undeclared here (not in a function)
/home/bill/bttv-0.9.15/bt832.c:275: error: implicit declaration of function 'I2C_DEVNAME'
/home/bill/bttv-0.9.15/bt832.c:275: error: initializer element is not constant
/home/bill/bttv-0.9.15/bt832.c:275: error: (near initialization for 'client_template.flags')
/home/bill/bttv-0.9.15/bt832.c:276: error: 'I2C_CLIENT_ALLOW_USE' undeclared here (not in a function)
make[2]: *** [/home/bill/bttv-0.9.15/bt832.o] Error 1
make[1]: *** [_module_/home/bill/bttv-0.9.15] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27.4'
make: *** [default] 错误 2
bill@Bill:~/bttv-0.9.15>
[/code]
系统版本: suse 11.0 原内核为:2.6.25.5-1.1
内核版本: linux-2.6.27.4
哪位大侠帮帮忙莎
任务就来了,在V4L3L2官方下了一个bttv-0.9.15,放到机器上来编译,却是编译不过去,我怀疑是不是内核版本
这些环境不同引发的,所报错误如下:
[code=INIFile]bill@Bill:~/bttv-0.9.15> make -f Makefile.old
make -C /lib/modules/2.6.27.4-pae/build SUBDIRS=/home/bill/bttv-0.9.15 modules
make[1]: Entering directory `/usr/src/linux-2.6.27.4'
CC [M] /home/bill/bttv-0.9.15/bt832.o
/home/bill/bttv-0.9.15/bt832.c:34:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:34:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:34:40: error: missing binary operator before token "("
In file included from /home/bill/bttv-0.9.15/bt832.c:42:
/home/bill/bttv-0.9.15/bttv.h:234:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bttv.h:234:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bttv.h:234:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bttv.h:284:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bttv.h:284:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bttv.h:284:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bttv.h:293:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bttv.h:293:27: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bttv.h:293:41: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c:177:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:177:27: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:177:41: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c:200:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:200:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:200:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c: In function 'bt832_probe':
/home/bill/bttv-0.9.15/bt832.c:217: error: 'I2C_ALGO_BIT' undeclared (first use in this function)
/home/bill/bttv-0.9.15/bt832.c:217: error: (Each undeclared identifier is reported only once
/home/bill/bttv-0.9.15/bt832.c:217: error: for each function it appears in.)
/home/bill/bttv-0.9.15/bt832.c:218: warning: passing argument 3 of 'i2c_probe' from incompatible pointer type
/home/bill/bttv-0.9.15/bt832.c:230:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:230:26: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:230:40: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c:263:5: warning: "LINUX_VERSION_CODE" is not defined
/home/bill/bttv-0.9.15/bt832.c:263:27: warning: "KERNEL_VERSION" is not defined
/home/bill/bttv-0.9.15/bt832.c:263:41: error: missing binary operator before token "("
/home/bill/bttv-0.9.15/bt832.c: At top level:
/home/bill/bttv-0.9.15/bt832.c:266: error: unknown field 'name' specified in initializer
/home/bill/bttv-0.9.15/bt832.c:266: warning: initialization makes integer from pointer without a cast
/home/bill/bttv-0.9.15/bt832.c:268: error: unknown field 'flags' specified in initializer
/home/bill/bttv-0.9.15/bt832.c:268: error: 'I2C_DF_NOTIFY' undeclared here (not in a function)
/home/bill/bttv-0.9.15/bt832.c:275: error: implicit declaration of function 'I2C_DEVNAME'
/home/bill/bttv-0.9.15/bt832.c:275: error: initializer element is not constant
/home/bill/bttv-0.9.15/bt832.c:275: error: (near initialization for 'client_template.flags')
/home/bill/bttv-0.9.15/bt832.c:276: error: 'I2C_CLIENT_ALLOW_USE' undeclared here (not in a function)
make[2]: *** [/home/bill/bttv-0.9.15/bt832.o] Error 1
make[1]: *** [_module_/home/bill/bttv-0.9.15] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27.4'
make: *** [default] 错误 2
bill@Bill:~/bttv-0.9.15>
[/code]
系统版本: suse 11.0 原内核为:2.6.25.5-1.1
内核版本: linux-2.6.27.4
哪位大侠帮帮忙莎
|
两种可能
1)在编译模块之前,没有先编译真个内核
2)内核的版本与模块编译所需内核版本不匹配。
1)在编译模块之前,没有先编译真个内核
2)内核的版本与模块编译所需内核版本不匹配。