Skip to content

catkin build error: redefinition of 'struct i2c_msg'  #86

@xiangee2022

Description

@xiangee2022

When I run the "catkin build" command, the following error occurs, what is the cause? How to solve? Any help from you will be appreciated!

Errors << ubiquity_motor:make /home/ubuntu/catkin_ws/logs/ubiquity_motor/build.make.002.log
In file included from /home/ubuntu/catkin_ws/src/ubiquity_motor/src/motor_hardware.cc:38:0:
/usr/include/linux/i2c.h:68:8: error: redefinition of 'struct i2c_msg'
struct i2c_msg {
^
In file included from /home/ubuntu/catkin_ws/src/ubiquity_motor/src/motor_hardware.cc:37:0:
/usr/include/linux/i2c-dev.h:37:8: error: previous definition of 'struct i2c_msg'
struct i2c_msg {
^
In file included from /home/ubuntu/catkin_ws/src/ubiquity_motor/src/motor_hardware.cc:38:0:
/usr/include/linux/i2c.h:129:7: error: redefinition of 'union i2c_smbus_data'
union i2c_smbus_data {
^
In file included from /home/ubuntu/catkin_ws/src/ubiquity_motor/src/motor_hardware.cc:37:0:
/usr/include/linux/i2c-dev.h:89:7: error: previous definition of 'union i2c_smbus_data'
union i2c_smbus_data {
^
make[2]: *** [CMakeFiles/ubiquity_motor.dir/src/motor_hardware.cc.o] Error 1
make[1]: *** [CMakeFiles/ubiquity_motor.dir/all] Error 2
make: *** [all] Error 2
cd /home/ubuntu/catkin_ws/build/ubiquity_motor; catkin build --get-env ubiquity_motor | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
......................................................................................................................................
Failed << ubiquity_motor:make [ Exited with code 2 ]
Failed <<< ubiquity_motor [ 19.7 seconds ]
Abandoned <<< magni_bringup [ Unrelated job failed ]
Abandoned <<< magni_demos [ Unrelated job failed ]
Finished <<< spot_micro_motion_cmd [ 1 minute and 21.9 seconds ]
[build] Summary: 20 of 23 packages succeeded.
[build] Ignored: 2 packages were skipped or are blacklisted.
[build] Warnings: None.
[build] Abandoned: 2 packages were abandoned.
[build] Failed: 1 packages failed.
[build] Runtime: 1 minute and 29.3 seconds total.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions