天嵌 ARM开发社区

 找回密码
 注册
查看: 1901|回复: 2

i2c-rw.c 编译出现很多错误

[复制链接]
snowboy521 发表于 2011-2-23 15:42:26 | 显示全部楼层 |阅读模式
今天测试I2C的测试程序,在编译测试程序的时间出了很多的错误。又不知道原因
编译器 3.4.5
内核  linux-2.6.30.4
错误如下:一部分
希望有经验的人可以帮个忙
   /opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/linux/i2c.h:95: error: previous declaration of 'i2c_smbus_read_i2c_block_data' was here
/opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/linux/i2c-dev.h:311: error: conflicting types for 'i2c_smbus_read_i2c_block_data'
/opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/linux/i2c.h:95: error: previous declaration of 'i2c_smbus_read_i2c_block_data' was here
i2c_rw.c:28: error: redefinition of 'i2c_smbus_access'
/opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/linux/i2c-dev.h:197: error: previous definition of 'i2c_smbus_access' was here
make: *** [i2c_rw] Error 1
天嵌_support1 发表于 2011-2-24 13:17:57 | 显示全部楼层
你用4.3.3版本的编译器吧,网友
回复

使用道具 举报

 楼主| snowboy521 发表于 2011-3-3 08:51:01 | 显示全部楼层
4.3.3版本的编译器 好用,没有错误了。谢谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-5-3 11:03 , Processed in 2.030043 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表