[i2c] i2c-dev cross-compile error
Jean Delvare
khali at linux-fr.org
Thu Jan 3 10:33:02 CET 2008
Hi Roberto,
Le 2/1/2008, Roberto Marino a écrit:
>I've a problem with i2c-dev on arm.
>I'm trying to cross-compile i2c-dev example
>(Documentation/i2c/dev-interface) for arm passing these arguments to
>cross-compiler
>
>arm-linux-gcc-3.4.1 -I/usr/local/arm/3.4.1/arm-linux/include -O2
>prova_max1363.c -o prova_max1363
>
>The error is this (too long to paste completely):
>(...)
>-----------------------------
>
>This is the source, any idea? :
>
>#include <linux/i2c.h>
>#include <linux/i2c-dev.h>
You are not supposed to include i2c.h from user-space. You should only
include i2c-dev.h, and this should be the one that is shipped in the
i2c-tools [1] package, NOT the one in the kernel tree.
I know that this is error-prone (although it _is_ explained in the
document you mentioned) and that's one thing I intend to fix in the
course of year 2008.
[1] http://www.lm-sensors.org/wiki/I2CTools
>#include <stdio.h>
>#include <stdlib.h>
>#include <sys/types.h>
>#include <sys/stat.h>
>#include <fcntl.h>
>(...)
--
Jean Delvare
More information about the i2c
mailing list