Hi all,

I'm setting up several Bela for a project but one of them (weirdly) will not build projects - this error occurs when building the basic example.

Building I2c_Codec.cpp...
In file i2c-dev.h: redefinition of 'i2c_msg' column: 8, line: 37
In file i2c-dev.h: redefinition of 'i2c_smbus_data' column: 7, line: 89

I did update this Bela to today's master branch of the repo (9bb8a12) and SCP'd over my patch, but couldn't get it to build.

Looks like this is a well-known problem in other contexts, but I haven't seen anything on this forum about it.

Any clues?

--Charles.

Hello,
sorry for the late response. Did you - by any chance - recently install the package libi2c-dev ?
That would install an alternate version of the file in /usr/include/linux/i2c.h which causes this problem.

I had this fixed this in the dev branch, now it should also be working from the current master branch, if you update your board again.

Hey @giuliomoro - this was on (what I think was) a fresh SD (supplied with the Bela kits), so we hadn't installed any new packages (as far as I know): I just booted it, updated, copied my patch, then found it wouldn't build - weird!

I worked around by using another SD card (we have a few purchased for building an installation). But I will get back to the borked one next week and see if I can fix it with the new commits on the master branch.

Thanks!

Ok, well a stock image would not have that libi2c-dev installed, and therefore it should not give you that error ... very weird. See if you can dig deeper into it. To check if it is installed, try:

dpkg -l | grep libi2c-dev
9 days later

The explanation for this - as we found out during a conference dinner on a boat on the Thames last week - seems to be that @charlesmatarles used the SD card that was previously used by victorgonzalez, which therefore included libi2c-dev, which was not yet supported on the master branch. Now it is supported so this should just work with the latest master.

9 months later