Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xiangee2022 opened this issue Nov 12, 2022 · 1 comment
Open

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

xiangee2022 opened this issue Nov 12, 2022 · 1 comment

Comments

@xiangee2022
Copy link

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.

@xiangee2022 xiangee2022 changed the title Error: redefinition of 'struct i2c_msg' catkin build Error: redefinition of 'struct i2c_msg' Nov 12, 2022
@xiangee2022 xiangee2022 changed the title catkin build Error: redefinition of 'struct i2c_msg' catkin build error: redefinition of 'struct i2c_msg' Nov 12, 2022
@xiangee2022
Copy link
Author

I found that removing the ubiquity_motor directory under the src directory can compile and pass. But I don't know if this will have any side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant