ros / bond_core

Maintains a bond (i.e. heart beat ) between ROS nodes and provides feedback when the bond is broken
http://www.ros.org/wiki/bond_core
35 stars 64 forks source link

'BondSM' defined as a struct here but previously declared as a class #51

Open VasuAgrawal opened 5 years ago

VasuAgrawal commented 5 years ago

I get this error when compiling a piece of code which uses bondcpp with clang. Compile command is as follows:

catkin build -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_BUILD_TYPE=Release
Errors     << iarc7_safety:make /home/vasu/Documents/projects/SubT/workspaces/stix_release/ugv/logs/iarc7_safety/build.make.000.log
In file included from /home/vasu/Documents/projects/SubT/workspaces/stix_release/ugv/src/iarc7_safety/src/iarc7_safety/SafetyClient.cpp:13:
In file included from /home/vasu/Documents/projects/SubT/workspaces/stix_release/ugv/src/iarc7_safety/include/iarc7_safety/SafetyClient.hpp:13:
/opt/ros/melodic/include/bondcpp/bond.h:189:1: error: 'BondSM' defined as a struct here but previously declared as a class [-Werror,-Wmismatched-tags]
struct BondSM
^
/opt/ros/melodic/include/bondcpp/BondSM_sm.h:25:1: note: did you mean struct here?
class BondSM;
^~~~~
struct
1 error generated.
make[2]: *** [CMakeFiles/iarc7_safety.dir/src/iarc7_safety/SafetyClient.cpp.o] Error 1
make[1]: *** [CMakeFiles/iarc7_safety.dir/all] Error 2
make: *** [all] Error 2

Direct link to affected code:

https://github.com/ros/bond_core/blob/2e9289d58b74ea995577b822a586442c583a6c10/bondcpp/include/bondcpp/bond.h#L189

flixr commented 4 years ago

@VasuAgrawal it would be great if you could make a PR for this

mjcarroll commented 2 years ago

@VasuAgrawal do you have any further information on this? What version of ROS are you using? What version of bond are you using?