itead/Segnix

SDK I2C Compilation Problem

hallard opened this issue · 1 comments

Here is the tip to avoid the following error message (on my Pi B+) according smbus

root@pi04:~/SDK# make
make -C lib all
make[1]: Entering directory '/root/SDK/lib'
make -C c libiteadc.so
make[2]: Entering directory '/root/SDK/lib/c'
gcc -O2 -fpic -shared -o libiteadc.so *.c -I../../include
In file included from itead_wire.c:37:0:
/usr/include/linux/i2c-dev.h:38:8: error: redefinition of ‘struct i2c_msg’
/usr/include/linux/i2c.h:68:8: note: originally defined here
/usr/include/linux/i2c-dev.h:90:7: error: redefinition of ‘union i2c_smbus_data’
/usr/include/linux/i2c.h:128:7: note: originally defined here

edit the file lib/c/itead_wire.c and comment the line which include linux/i2c.h since I2C definitions are already in i2c-dev.h. It avoid duplication definition at compilation

include <linux/types.h>
//#include <linux/i2c.h>

include <linux/i2c-dev.h>

I think the Segnix library is discontinued.