Open skoehler opened 7 years ago
See this Blog comment, should solve your issue ;-)
I'm using Arch Linux. The problem is not that I'm missing some packages. I have lm_sensors and I have the equivalent of i2c -tools and libi2c-dev installed (/usr/include/linux/i2c-dev.h exists) but the functions like i2c_smbus_write_word_data are simply not part of the header files anymore. On Debian, i2c-dev.h still declares i2c_smbus_write_word_data and friends - but on Arch Linux that is simply not the case.
Looking at the sources of libraries such as MRAA, they just use ioctl's for i2c-IO. The corresponding structs like i2c_smbus_ioctl_data are present in /usr/include/linux/i2c-dev.h.
I believe this library is using functions (that is i2c_smbus_write_word_data and friends) that have been deprecated and are bound to disappear from future releases of the i2c library.
Arch has i2c-tools 3.1.2 while Debian Jessie (and thus Raspbian) has libi2c-dev version 3.1.1.
Workaround: It seems i2c_smbus_write_word_data and friends are inline function that can simply be copied to the source of this library to make things work for now.
Hi @skoehler, Is there a workaround for getting the older versions of libi2c-dev and i2c-tools where the commands "i2c_smbus_write_word_data and friends" are included? It seems that these functions are deprecated since a long time now (the newest version of i2c is 4.0) but I need the old commands to compile old libraries that still use them. There isn't a separate package for these versions, so how can I get them?
The i2c_smbus_write functions seem to not exist on my system.
The compilation work, but when linking the examples we get undefined symbol errors.