minimu9-ahrs icon indicating copy to clipboard operation
minimu9-ahrs copied to clipboard

Build error on archlinux

Open gaetanww opened this issue 7 years ago • 3 comments

Hi,

I'm trying to build minimu9-ahrs on archlinux. I get the following errors while building:

i2c_bus.cpp: In member function 'void i2c_bus::write_byte_and_read(uint8_t, uint8_t, uint8_t*, size_t)':
i2c_bus.cpp:80:38: error: invalid use of incomplete type 'struct i2c_msg'
     { address, 0, 1, (typeof(i2c_msg().buf)) &command },

In file included from i2c_bus.cpp:8:0:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
struct i2c_msg *msgs; /* pointers to i2c_msgs */

Did I make a mistake while installing the headers or is that something else?

gaetanww avatar Feb 14 '18 19:02 gaetanww

The Linux developers must have made some breaking changes in their header files. Could you try adding #include <linux/i2c.h> near the top of that file?

DavidEGrayson avatar Feb 14 '18 20:02 DavidEGrayson

I tried what you suggested and the build worked. Thank you very much ! I also had to add #include <sys/ioctl.h> on top of i2c_bus.h.

gaetanww avatar Feb 15 '18 11:02 gaetanww

Great! thank you @DavidEGrayson @gaetanww, it worked fine for me too on my Jetson TX2. Just added:

i2c-bus=/dev/i2c-1

in ~/.minimu9-ahrs

andrewssobral avatar May 26 '19 22:05 andrewssobral

This was fixed by c42cca6c225d47def454c41542accd36ded454da .

DavidEGrayson avatar Jul 11 '23 00:07 DavidEGrayson