ethz-asl / rotors_simulator

RotorS is a UAV gazebo simulator
1.2k stars 756 forks source link

catkin build error on Ubuntu20.04 port_def.inc: no such file or directory #691

Open PengqinWANG opened 2 years ago

PengqinWANG commented 2 years ago

My system is Ubuntu20.04, Gazebo11, ROS Noetic. When my protobuf version < 3.7 like libprotoc 3.6.1 or 3.0.0, the result of catkin build shows: Errors << rotors_gazebo_plugins:make /home/rhine/vrep_ws/logs/rotors_gazebo_plugins/build.make.001.log
In file included from /home/rhine/vrep_ws/build/rotors_gazebo_plugins/ConnectGazeboToRosTopic.pb.cc:4: /home/rhine/vrep_ws/build/rotors_gazebo_plugins/ConnectGazeboToRosTopic.pb.h:10:10: fatal error: google/protobuf/port_def.inc: no such file or directory 10 | #include <google/protobuf/port_def.inc> | ^~~~~~~~~~ compilation terminated. In file included from /home/rhine/vrep_ws/build/rotors_gazebo_plugins/Actuators.pb.cc:4: /home/rhine/vrep_ws/build/rotors_gazebo_plugins/Actuators.pb.h:10:10: fatal error: google/protobuf/port_def.inc: no such file or directory 10 | #include <google/protobuf/port_def.inc> | ^~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/mav_msgs.dir/build.make:329:CMakeFiles/mav_msgs.dir/ConnectGazeboToRosTopic.pb.cc.o] error 1

When my protobuf version > 3.7 like libprotoc 3.7.1 or 3.19.1, the result of catkin build shows: usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/PoseWithCovariance.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:33, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/PoseWithCovariance.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/PoseWithCovariance.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is 17 | #error This file was generated by an older version of protoc which is | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please 18 | #error incompatible with your Protocol Buffer headers. Please | ^~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc. 19 | #error regenerate this file with a newer version of protoc. | ^~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:143:30: error: ‘google::protobuf::uint8 gazebo::msgs::Quaternion::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:143:30: error: ‘google::protobuf::uint8 gazebo::msgs::Vector3d::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:20:8: error: ‘PROTOBUF_INTERNAL_EXPORT_vector3d_2eproto’ does not name a type; did you mean ‘PROTOBUF_INTERNAL_EXPORT_Header_2eproto’? 20 | extern PROTOBUF_INTERNAL_EXPORT_vector3d_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Vector3d_vector3d_2eproto; | ^~~~~~~~~ | PROTOBUF_INTERNAL_EXPORT_Header_2eproto In file included from /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:33, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/PoseWithCovariance.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:143:30: error: ‘google::protobuf::uint8 gazebo::msgs::Vector3d::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:41:8: error: ‘scc_info_Vector3d_vector3d_2eproto’ was not declared in this scope; did you mean ‘scc_info_Header_Header_2eproto’? 41 | &scc_info_Vector3d_vector3d_2eproto.base,}}; | ^~~~~~~~~~ | scc_info_Header_Header_2eproto In file included from /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/PoseWithCovariance.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:143:30: error: ‘google::protobuf::uint8 gazebo::msgs::Quaternion::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc: In function ‘void AddDescriptors_MagneticField_2eproto()’: /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:95:7: error: ‘::AddDescriptors_quaternion_2eproto’ has not been declared; did you mean ‘AddDescriptors_Header_2eproto’? 95 | ::AddDescriptors_quaternion_2eproto, | ^~~~~~~~~ | AddDescriptors_Header_2eproto In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/PoseWithCovariance.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Odometry.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/pose.pb.h:145:30: error: ‘google::protobuf::uint8 gazebo::msgs::Pose::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 145 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:96:7: error: ‘::AddDescriptors_vector3d_2eproto’ has not been declared; did you mean ‘AddDescriptors_Header_2eproto’? 96 | ::AddDescriptors_vector3d_2eproto, | ^~~~~~~ | AddDescriptors_Header_2eproto In file included from /home/rhine/anaconda3/envs/tf/include/google/protobuf/map_type_handler.h:35, from /home/rhine/anaconda3/envs/tf/include/google/protobuf/map.h:49, from /home/rhine/anaconda3/envs/tf/include/google/protobuf/generated_message_table_driven.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.h:26, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:4: /home/rhine/anaconda3/envs/tf/include/google/protobuf/wire_format_lite_inl.h: In instantiation of ‘static google::protobuf::uint8 google::protobuf::internal::WireFormatLite::InternalWriteMessageToArray(int, const MessageType&, google::protobuf::uint8) [with MessageType = gazebo::msgs::Vector3d; google::protobuf::uint8 = unsigned char]’: /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:422:55: required from here /home/rhine/anaconda3/envs/tf/include/google/protobuf/wire_format_lite_inl.h:905:62: error: no matching function for call to ‘gazebo::msgs::Vector3d::InternalSerializeWithCachedSizesToArray(google::protobuf::uint8&) const’ 905 | return value.InternalSerializeWithCachedSizesToArray(target); | ^ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/MagneticField.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:143:30: note: candidate: ‘google::protobuf::uint8 gazebo::msgs::Vector3d::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:143:30: note: candidate expects 2 arguments, 1 provided In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:143:30: error: ‘google::protobuf::uint8 gazebo::msgs::Quaternion::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:35, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/vector3d.pb.h:143:30: error: ‘google::protobuf::uint8 gazebo::msgs::Vector3d::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ marked ‘final’, but is not virtual 143 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:20:8: error: ‘PROTOBUF_INTERNAL_EXPORT_quaternion_2eproto’ does not name a type; did you mean ‘PROTOBUF_INTERNAL_EXPORT_Header_2eproto’? 20 | extern PROTOBUF_INTERNAL_EXPORT_quaternion_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Quaternion_quaternion_2eproto; | ^~~~~~~~~~~ | PROTOBUF_INTERNAL_EXPORT_Header_2eproto /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:21:8: error: ‘PROTOBUF_INTERNAL_EXPORT_vector3d_2eproto’ does not name a type; did you mean ‘PROTOBUF_INTERNAL_EXPORT_Header_2eproto’? 21 | extern PROTOBUF_INTERNAL_EXPORT_vector3d_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Vector3d_vector3d_2eproto; | ^~~~~~~~~ | PROTOBUF_INTERNAL_EXPORT_Header_2eproto /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:42:8: error: ‘scc_info_Quaternion_quaternion_2eproto’ was not declared in this scope 42 | &scc_info_Quaternion_quaternion_2eproto.base, | ^~~~~~~~~~ /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:43:8: error: ‘scc_info_Vector3d_vector3d_2eproto’ was not declared in this scope; did you mean ‘scc_info_Header_Header_2eproto’? 43 | &scc_info_Vector3d_vector3d_2eproto.base,}}; | ^~~~~~~~~~ | scc_info_Header_Header_2eproto /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc: In function ‘void AddDescriptors_Imu_2eproto()’: /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:109:7: error: ‘::AddDescriptors_quaternion_2eproto’ has not been declared; did you mean ‘AddDescriptors_Header_2eproto’? 109 | ::AddDescriptors_quaternion_2eproto, | ^~~~~~~~~ | AddDescriptors_Header_2eproto /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:110:7: error: ‘::AddDescriptors_vector3d_2eproto’ has not been declared; did you mean ‘AddDescriptors_Header_2eproto’? 110 | ::AddDescriptors_vector3d_2eproto, | ^~~~~~~ | AddDescriptors_Header_2eproto make[2]: [CMakeFiles/mav_msgs.dir/build.make:452:CMakeFiles/mav_msgs.dir/MagneticField.pb.cc.o] error 1 make[2]: [CMakeFiles/mav_msgs.dir/build.make:478:CMakeFiles/mav_msgs.dir/Odometry.pb.cc.o] error 1 In file included from /home/rhine/anaconda3/envs/tf/include/google/protobuf/map_type_handler.h:35, from /home/rhine/anaconda3/envs/tf/include/google/protobuf/map.h:49, from /home/rhine/anaconda3/envs/tf/include/google/protobuf/generated_message_table_driven.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:26, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /home/rhine/anaconda3/envs/tf/include/google/protobuf/wire_format_lite_inl.h: In instantiation of ‘static google::protobuf::uint8 google::protobuf::internal::WireFormatLite::InternalWriteMessageToArray(int, const MessageType&, google::protobuf::uint8) [with MessageType = gazebo::msgs::Quaternion; google::protobuf::uint8 = unsigned char]’: /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:642:52: required from here /home/rhine/anaconda3/envs/tf/include/google/protobuf/wire_format_lite_inl.h:905:62: error: no matching function for call to ‘gazebo::msgs::Quaternion::InternalSerializeWithCachedSizesToArray(google::protobuf::uint8&) const’ 905 | return value.InternalSerializeWithCachedSizesToArray(target); | ^ In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:143:30: note: candidate: ‘google::protobuf::uint8 gazebo::msgs::Quaternion::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8) const’ 143 | ::google::protobuf::uint8 InternalSerializeWithCachedSizesToArray( | ^~~~~~~~~~~ /usr/include/gazebo-11/gazebo/msgs/quaternion.pb.h:143:30: note: candidate expects 2 arguments, 1 provided In file included from /home/rhine/anaconda3/envs/tf/include/google/protobuf/map_type_handler.h:35, from /home/rhine/anaconda3/envs/tf/include/google/protobuf/map.h:49, from /home/rhine/anaconda3/envs/tf/include/google/protobuf/generated_message_table_driven.h:34, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.h:26, from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4: /home/rhine/anaconda3/envs/tf/include/google/protobuf/wire_format_lite_inl.h: In instantiation of ‘static google::protobuf::uint8 google::protobuf::internal::WireFormatLite::InternalWriteMessageToArray(int, const MessageType&, google::protobuf::uint8) [with MessageType = gazebo::msgs::Vector3d; google::protobuf::uint8 = unsigned char]’: /home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:662:57: required from here /home/rhine/anaconda3/envs/tf/include/google/protobuf/wire_format_lite_inl.h:905:62: error: no matching function for call to ‘gazebo::msgs::Vector3d::InternalSerializeWithCachedSizesToArray(google::protobuf::uint8*&) const’ 905 | return value.InternalSerializeWithCachedSizesToArray(target);

Could anyone help me? Thank you!