我真的需要在arch linux上安装libi2c-dev来使用我将用来读取和写入Cubieboard 2上的I2C端口的I2C库。
PACMAN上不存在该包。
如果没有安装libi2c-dev,当我将代码与我希望使用的库一起编译时,我会收到以下编译器错误消息。
/tmp/cc2785Qg.o: In function `i2c_init':
WriteID.c:(.text+0x3c): undefined reference to `com_serial'
WriteID.c:(.text+0x40): undefined reference to `com_serial'
WriteID.c:(.text+0x7c): undefined reference to `com_serial'
WriteID.c:(.text+0x80): undefined reference to `com_serial'
/tmp/cc2785Qg.o: In function `i2c_set_pointer':
WriteID.c:(.text+0x114): undefined reference to `com_serial'
/tmp/cc2785Qg.o:WriteID.c:(.text+0x118): more undefined references to `com_serial' follow
/tmp/cc2785Qg.o: In function `i2c_set_pointer':
WriteID.c:(.text+0x124): undefined reference to `failcount'
WriteID.c:(.text+0x128): undefined reference to `failcount'
WriteID.c:(.text+0x134): undefined reference to `failcount'
WriteID.c:(.text+0x138): undefined reference to `failcount'
WriteID.c:(.text+0x144): undefined reference to `com_serial'
WriteID.c:(.text+0x148): undefined reference to `com_serial'
WriteID.c:(.text+0x154): undefined reference to `failcount'
WriteID.c:(.text+0x158): undefined reference to `failcount'
/tmp/cc2785Qg.o: In function `i2c_read':
WriteID.c:(.text+0x1e0): undefined reference to `com_serial'
WriteID.c:(.text+0x1e4): undefined reference to `com_serial'
WriteID.c:(.text+0x1f0): undefined reference to `failcount'
WriteID.c:(.text+0x1f4): undefined reference to `failcount'
WriteID.c:(.text+0x200): undefined reference to `failcount'
WriteID.c:(.text+0x204): undefined reference to `failcount'
WriteID.c:(.text+0x238): undefined reference to `com_serial'
WriteID.c:(.text+0x23c): undefined reference to `com_serial'
WriteID.c:(.text+0x248): undefined reference to `failcount'
WriteID.c:(.text+0x24c): undefined reference to `failcount'
/tmp/cc2785Qg.o: In function `i2c_write':
WriteID.c:(.text+0x354): undefined reference to `com_serial'
WriteID.c:(.text+0x358): undefined reference to `com_serial'
WriteID.c:(.text+0x364): undefined reference to `failcount'
WriteID.c:(.text+0x368): undefined reference to `failcount'
WriteID.c:(.text+0x374): undefined reference to `failcount'
WriteID.c:(.text+0x378): undefined reference to `failcount'
WriteID.c:(.text+0x3b0): undefined reference to `com_serial'
WriteID.c:(.text+0x3b4): undefined reference to `com_serial'
WriteID.c:(.text+0x3c0): undefined reference to `failcount'
WriteID.c:(.text+0x3c4): undefined reference to `failcount'
collect2: error: ld returned 1 exit status
我需要: 1.找到一种在arch linux上安装libi2c-dev的方法,或者 2.获取头文件I2C-DEV.H并手动#include它到我的项目文件夹中。
答案 0 :(得分:1)
$ git status -s
D secondB.txt
M shareLineFile.txt
?? fileA.txt
$ git diff --stat
shareLineFile.txt | 1 +
1 file changed, 1 insertion(+)
$ git add . --dry-run
add 'shareLineFile.txt'
add 'fileA.txt'
所以如果这是您要查找的文件和版本:
$ pacman -Qo /usr/include/linux/i2c-dev.h
/usr/include/linux/i2c-dev.h is owned by linux-api-headers 4.1.4-1