当前位置: 技术问答>linux和unix
编译错误
来源: 互联网 发布时间:2015-12-23
本文导语: 本人从网上下载了一个驱动程序,结果编译错误,郁闷啊 下面是程序中报错的位置 static struct i2c_algorithm saa7134_algo = { .name = "saa7134", //错误 .id = I2C_...
本人从网上下载了一个驱动程序,结果编译错误,郁闷啊
下面是程序中报错的位置
static struct i2c_algorithm saa7134_algo = {
.name = "saa7134", //错误
.id = I2C_ALGO_SAA7134, //错误
.master_xfer = saa7134_i2c_xfer,
.algo_control = algo_control,
.functionality = functionality,
};
错误信息
error: unknown field 'name' specified in initializer
warning: initialization from incompatible pointer type
error: unknown field 'id' specified in initializer
warning: initialization makes pointer from integer without a cast
应该怎么修改啊,我用的是gcc4.1
下面是程序中报错的位置
static struct i2c_algorithm saa7134_algo = {
.name = "saa7134", //错误
.id = I2C_ALGO_SAA7134, //错误
.master_xfer = saa7134_i2c_xfer,
.algo_control = algo_control,
.functionality = functionality,
};
错误信息
error: unknown field 'name' specified in initializer
warning: initialization from incompatible pointer type
error: unknown field 'id' specified in initializer
warning: initialization makes pointer from integer without a cast
应该怎么修改啊,我用的是gcc4.1
|
你的程序中有"//错误"这个吗?
我目前有的GCC2.95.3好像一有"//"就会报告错误,
试试把"//"改成"/* */"看看?
感觉好像是这个问题.
我目前有的GCC2.95.3好像一有"//"就会报告错误,
试试把"//"改成"/* */"看看?
感觉好像是这个问题.
|
the field "name" and "id" are not declared in the structure i2c_algorithm.
please check the delaration of struct i2c_algorithm{} whether the name/id are included there.
if possible, please provide the code which declare the struct for our reference.
struct ic2_algorithm {
.....
....
};
please check the delaration of struct i2c_algorithm{} whether the name/id are included there.
if possible, please provide the code which declare the struct for our reference.
struct ic2_algorithm {
.....
....
};