編譯linux時出現:“錯誤:數組元素的類型不完全”

系統:Fedora Core4

內核:2.6.11.1

出現錯誤:

1、

CC drivers/i2c/i2c-core.o
In file included from drivers/i2c/i2c-core.c:29:
include/linux/i2c.h:58: error: array type has incomplete element type
include/linux/i2c.h:197: error: array type has incomplete element type
drivers/i2c/i2c-core.c: In function ‘i2c_transfer’:
drivers/i2c/i2c-core.c:594: error: type of formal parameter 2 is incomplete
drivers/i2c/i2c-core.c: In function ‘i2c_master_send’:
drivers/i2c/i2c-core.c:620: error: type of formal parameter 2 is incomplete
drivers/i2c/i2c-core.c: In function ‘i2c_master_recv’:
drivers/i2c/i2c-core.c:649: error: type of formal parameter 2 is incomplete
make[2]: *** [drivers/i2c/i2c-core.o] 錯誤 1
make[1]: *** [drivers/i2c] 錯誤 2
make: *** [drivers] 錯誤 2

解決方法:

將include/linux/i2c.h中第58,197行內struct i2c_msg msg[]改爲struct i2c_msg *msg

2、

In file included from drivers/media/video/bttv-driver.c:42:
drivers/media/video/bttvp.h:233: 錯誤:數組元素的類型不完全
不允許類型在聲明前使用,因此調換次序就可以順利通過。

。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章