uzh-rpg/flightmare

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

PengqinWANG opened this issue · 12 comments

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/flight_ws/logs/rotors_gazebo_plugins/build.make.026.log
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/CommandMotorSpeed.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/CommandMotorSpeed.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:335:CMakeFiles/mav_msgs.dir/CommandMotorSpeed.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/ConnectGazeboToRosTopic.pb.cc:4:
/home/rhine/flight_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.
make[2]: *** [CMakeFiles/mav_msgs.dir/build.make:348:CMakeFiles/mav_msgs.dir/ConnectGazeboToRosTopic.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Actuators.pb.cc:4:
/home/rhine/flight_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:322:CMakeFiles/mav_msgs.dir/Actuators.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Float32.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/Float32.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/flight_ws/build/rotors_gazebo_plugins/FluidPressure.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/FluidPressure.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:374:CMakeFiles/mav_msgs.dir/Float32.pb.cc.o] error1
make[2]: *** [CMakeFiles/mav_msgs.dir/build.make:387:CMakeFiles/mav_msgs.dir/FluidPressure.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/ConnectRosToGazeboTopic.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/ConnectRosToGazeboTopic.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/flight_ws/build/rotors_gazebo_plugins/Imu.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/Imu.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:361:CMakeFiles/mav_msgs.dir/ConnectRosToGazeboTopic.pb.cc.o] error 1
make[2]: *** [CMakeFiles/mav_msgs.dir/build.make:413:CMakeFiles/mav_msgs.dir/Imu.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Header.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/Header.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:400:CMakeFiles/mav_msgs.dir/Header.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/JointState.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/JointState.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:426:CMakeFiles/mav_msgs.dir/JointState.pb.cc.o] error 1
In file included from /home/rhine/flight_ws/build/rotors_gazebo_plugins/Lidar.pb.cc:4:
/home/rhine/flight_ws/build/rotors_gazebo_plugins/Lidar.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:439:CMakeFiles/mav_msgs.dir/Lidar.pb.cc.o] error 1
make[1]: *** [CMakeFiles/Makefile2:1109:CMakeFiles/mav_msgs.dir/all] error 2

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);

I would appreciate it if I could receive your reply.
Thank you!

Hi! I have run into the same issue. Did you find any solution for this issue? Thank you in advance. It is weird that nobody has commented on this issue yet.

Hi! I have run into the same issue. Did you find any solution for this issue? Thank you in advance. It is weird that nobody has commented on this issue yet.

Hi! I recommend you to use flightmare on Ubuntu18.04 since when I tried 18.04 everything worked well. And actually we have not found any solutions of this issue on Ubuntu20.04.

Thanks for your recommendation. There was a conflict between protoc 3.6.4 and 3.0.0 after installing via apt and implementing the fix from the wiki. I tried with only the 3.0.0 installed and having the same version returned from usr/bin and usr/bin/local, but no luck with that either. I will try Ubuntu 18.04. It is a shame that it does not work on 20.04 though.

Same problem!

I actually found a workaround that may be able to help you out. The problem is that Ubuntu 20.04 inherently works with Gazebo 11, which is built with protoc 3.6.1. Protoc 3.0.0 is only used for Gazebo 9 on Ubuntu 18.04.
If you would like to keep using 20.04, which I am still doing, you have 2 options imo:

  1. Use a docker image for Ubuntu 18.04 and follow the guide to install Flightmare, then use VNC viewer to use the graphical interfaces and actually use Flightmare
  2. Use Ubuntu 20.04 without Gazebo 11 as only the gazebo_rotors simulator actually uses Gazebo 11, you can still use all the other launch scripts in flightros (e.g. roslaunch flightros camera.launch)

To facilitate the second option, you would have to remove all instances of protoc before attempting to build since you only want the inherent protoc 3.6.1. Let me know if you would like some help with that.

I really appreciate your sincere answer. Actually, I'm trying to configure this project. However, it is explained here that Ubuntu 20.04 and ROS noetic are used(So I think gazebo11 is used defaulty). Such an issue also appear when I try to use "catkin_build". Do you have some good idea? Please let me know.

| #include <google/protobuf/port_def.inc>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

You could check out this comment to check whether there are no protobuf version discrepancies on your system.
Also, maybe you could try catkin_make instead of catkin build, sometimes it gives some more error information.

thanks bro! Your answer solves my problem~

I actually found a workaround that may be able to help you out. The problem is that Ubuntu 20.04 inherently works with Gazebo 11, which is built with protoc 3.6.1. Protoc 3.0.0 is only used for Gazebo 9 on Ubuntu 18.04. If you would like to keep using 20.04, which I am still doing, you have 2 options imo:

  1. Use a docker image for Ubuntu 18.04 and follow the guide to install Flightmare, then use VNC viewer to use the graphical interfaces and actually use Flightmare
  2. Use Ubuntu 20.04 without Gazebo 11 as only the gazebo_rotors simulator actually uses Gazebo 11, you can still use all the other launch scripts in flightros (e.g. roslaunch flightros camera.launch)

To facilitate the second option, you would have to remove all instances of protoc before attempting to build since you only want the inherent protoc 3.6.1. Let me know if you would like some help with that.

Hi! I believe I encountered the same issue with the protobuf version error. My system is Ubuntu20.04, Gazebo11, ROS Noetic.

I am wondering if you could provide more details about facilitating the second option without reinstalling Ubuntu 18.04. Thanks a lot!

Hi
You should check my answer on Oct 21 2022. Use the link to check whether protoc/protobuf is installed on your system.

The easiest way to install flightmare is follow the install guide and skip the step where it says you need protoc 3.0.0. The protoc version that gets installed automatically works fine, you may need to install additional ros-noetic-**** packages whenever you get a compiler error pointing to the missing package.