variable `xxx' has initializer but incomplete type

来源:互联网 发布:郑州360排名优化 编辑:程序博客网 时间:2024/05/29 16:12

说明xxx对应的类型没有找到,类型需要定义.


static struct i2c_driver touchkey_i2c_driver  =
{
.driver = {
.owner = THIS_MODULE, 
.name = "i2ctouchpannel",
},
.probe = &i2ctouchpannel_probe,
.remove = &i2ctouchpannel_remove,
.id_table = i2ctouch_pannel,
};

在调用内核已经定义好的结构体去初始化我们定义的变量的时候,

如出现 variable 'touchkey_i2c_driver' has initializer but incomplete type,其实就是说明touchkey_i2c_driver 没有被定义,进而说明是“i2c_driver 

没有被定义,更进一步,其实就是没有#include 相对应的头文件。


如#include <linux/i2c.h>之后,就不会出现variable 'touchkey_i2c_driver' has initializer but incomplete type