2
votes

I REALLY need to install libi2c-dev on arch linux to make use of an I2C library that I will use to read and write to I2C ports on the Cubieboard 2.

The package does not exist on PACMAN.

Without libi2c-dev installed, i receive the following compiler error messages when I compile my code along with the library I wish to use.

/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

I need to either: 1. Find a way to install libi2c-dev on arch linux, or 2. Get the header file I2C-DEV.H and manually #include it into my project folder.

1
where is com_serial,failcount function's definitions? There is no definition of this function in libi2c-dev - Rahul R Dhobi
Basically, I am following this tutorial: linux-sunxi.org/I2Cdev#Configuring_your_FEX It states libi2c-dev should be installed. Of course, I cannot fine ANY definitions in libi2c-dev's i2c-dev.h file. - StuartKerr
ok so you need only i2cdev package or its file? - Rahul R Dhobi
Did you solve it? If yes, then put resolution in answers. - grimsock

1 Answers

1
votes
$ pacman -Qo /usr/include/linux/i2c-dev.h                                    
/usr/include/linux/i2c-dev.h is owned by linux-api-headers 4.1.4-1

So provided this is the file and version you are looking for:

$ pacman -S linux-api-headers