Closed Q-point closed 7 years ago
Hi,
your /usr/include/linux/i2c-dev.h file seems to be redefining everything that is in /usr/include/linux/i2c.h? This is considerably different to what I have on my system. Could you post these two files here?
Also which version of jessie are you using?
Hi,
I am using the latest version on Rasbian. Kernel 4.4. The issue was due to the libi2c-dev.
Everything works fine after issuing : sudo apt-get remove libi2c-dev
ahh confirmed at my end too. After installing libi2c-dev I have this in /usr/include/linux:
$ ls -l i2c*
-rw-r--r-- 1 root root 10414 Oct 3 2015 i2c-dev.h
-rw-r--r-- 1 root root 2427 Sep 23 2015 i2c-dev.h.kernel
-rw-r--r-- 1 root root 6772 Sep 23 2015 i2c.h
I should be able to work this into the config somehow
thanks, F.
I've patched with a test for the alternate header file now. If you have the chance could you test the patch on your system?
git clone -b 0.4.1-i2c-header-conflict https://github.com/frasersdev/librpip
I'll give it a try and let you know. Thanks.
fixed in 0.4.1
I am getting the following error when I try to install the library.
`gcc -fpic -g -Wall -O3 -c -o rpi.o rpi.c In file included from transact.c:28:0: /usr/include/linux/i2c-dev.h:37:8: error: redefinition of ‘struct i2c_msg’ struct i2c_msg { ^ In file included from transact.c:27:0: /usr/include/linux/i2c.h:68:8: note: originally defined here struct i2c_msg { ^ In file included from transact.c:28:0: /usr/include/linux/i2c-dev.h:89:7: error: redefinition of ‘union i2c_smbus_data’ union i2c_smbus_data { ^ In file included from transact.c:27:0: /usr/include/linux/i2c.h:128:7: note: originally defined here union i2c_smbus_data { ^ In file included from i2c.c:29:0: /usr/include/linux/i2c-dev.h:37:8: error: redefinition of ‘struct i2c_msg’ struct i2c_msg { ^ In file included from i2c.c:28:0: /usr/include/linux/i2c.h:68:8: note: originally defined here struct i2c_msg { ^ In file included from i2c.c:29:0: /usr/include/linux/i2c-dev.h:89:7: error: redefinition of ‘union i2c_smbus_data’ union i2c_smbus_data { ^ In file included from i2c.c:28:0: /usr/include/linux/i2c.h:128:7: note: originally defined here union i2c_smbus_data { ^ transact.c: In function ‘librpip_transaction_i2c_create’: transact.c:451:11: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] p->buf = m->tx->buf; ^ transact.c:455:11: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] p->buf = m->rx->buf; ^