-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined reference to i2c_smbus_write_byte_data #15
Comments
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, |
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.
The text was updated successfully, but these errors were encountered: