[i2c] Newbie C compilation error

Dave Hylands dhylands at gmail.com
Fri Oct 27 16:39:49 CEST 2006


Hi Pierre,

Replying to the list this time....

> "All the above it caused by you including <linux/i2c.h>. As explained
> before, this is a kernel-only header file, which you must _not_ include
> in user-space code. You are not the only one to blame though, as in
> fact this header file should not be in /usr/include at all, this is a
> mistake which should be fixed "soon". "
>
> I just included the file i2c-dev.h, which solve most of the compilation
> errors except the one regarding the define I2C_SLAVE.
>
> I did a grep on this define, and apparently it is only defined in the i2c.h
> file :-)


Go over here:
http://www.lm-sensors.org/

and download the lm_sensors-2.10.1.tar.gz tarball. In there you should
find a kernel/include/i2c-dev.h that is suitable for use from user
mode programs

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/



More information about the i2c mailing list