PX4-Autopilot: 'px4_sitl gazebo' errors when performing third build step
Hi there,
I ran make px4_sitl gazebo
and got tons of errors in the third build step.
I ran source ubuntu_sim.sh
before making
I also followed the dependencies for ROS/Gazebo.
I can run make px4_sitl_default jmavsim
correctly but got the errors for gazebo.
Thanks for your help!
[3/6] Performing build step for 'sitl_gazebo'
FAILED: cd /home/csgurel/src/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /home/csgurel/src/Firmware/build/px4_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-build
[1/50] Building CXX object CMakeFiles/sensor_msgs.dir/Imu.pb.cc.o
[2/50] Linking CXX shared library libmav_msgs.so
[3/50] Linking CXX shared library libstd_msgs.so
[4/50] Building CXX object CMakeFiles/sensor_msgs.dir/Range.pb.cc.o
[5/50] Building CXX object CMakeFiles/sensor_msgs.dir/SITLGps.pb.cc.o
[6/50] Building CXX object CMakeFiles/sensor_msgs.dir/OpticalFlow.pb.cc.o
[7/50] Building CXX object CMakeFiles/nav_msgs.dir/Odometry.pb.cc.o
[8/50] Linking CXX static library OpticalFlow/klt_feature_tracker/libklt_feature_tracker.a
[9/50] Building CXX object CMakeFiles/physics_msgs.dir/Wind.pb.cc.o
[10/50] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/optical_flow.cpp.o
[11/50] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/px4flow.cpp.o
[12/50] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/flow_px4.cpp.o
[13/50] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/flow_opencv.cpp.o
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Dphysics_msgs_EXPORTS -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/local/include -isystem /usr/include/sdformat-6.2 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/csgurel/src/Firmware/Tools/sitl_gazebo/include -I. -I/usr/include/eigen3 -I/usr/include/eigen3/eigen3 -I/usr/include/gazebo-9/gazebo/msgs -I/home/csgurel/src/Firmware/mavlink/include -I/usr/include/Paging -isystem /opt/ros/kinetic/include/opencv-3.3.1-dev -isystem /opt/ros/kinetic/include/opencv-3.3.1-dev/opencv -I/home/csgurel/src/Firmware/Tools/sitl_gazebo/external/OpticalFlow/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/physics_msgs.dir/Wind.pb.cc.o -MF CMakeFiles/physics_msgs.dir/Wind.pb.cc.o.d -o CMakeFiles/physics_msgs.dir/Wind.pb.cc.o -c Wind.pb.cc
In file included from Wind.pb.h:32:0,
from Wind.pb.cc:5:
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from Wind.pb.cc:5:0:
Wind.pb.h: In member function ‘const gazebo::msgs::Vector3d& physics_msgs::msgs::Wind::force() const’:
Wind.pb.h:318:8: error: ‘_Vector3d_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Vector3d_default_instance_);
^
Wind.pb.cc: In static member function ‘static void physics_msgs::msgs::protobuf_Wind_2eproto::TableStruct::InitDefaultsImpl()’:
Wind.pb.cc:98:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::InitDefaults();
^
Wind.pb.cc:102:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
Wind.pb.cc: In function ‘void physics_msgs::msgs::protobuf_Wind_2eproto::{anonymous}::AddDescriptorsImpl()’:
Wind.pb.cc:122:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::AddDescriptors();
^
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Dsensor_msgs_EXPORTS -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/local/include -isystem /usr/include/sdformat-6.2 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/csgurel/src/Firmware/Tools/sitl_gazebo/include -I. -I/usr/include/eigen3 -I/usr/include/eigen3/eigen3 -I/usr/include/gazebo-9/gazebo/msgs -I/home/csgurel/src/Firmware/mavlink/include -I/usr/include/Paging -isystem /opt/ros/kinetic/include/opencv-3.3.1-dev -isystem /opt/ros/kinetic/include/opencv-3.3.1-dev/opencv -I/home/csgurel/src/Firmware/Tools/sitl_gazebo/external/OpticalFlow/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/sensor_msgs.dir/Imu.pb.cc.o -MF CMakeFiles/sensor_msgs.dir/Imu.pb.cc.o.d -o CMakeFiles/sensor_msgs.dir/Imu.pb.cc.o -c Imu.pb.cc
In file included from Imu.pb.h:32:0,
from Imu.pb.cc:5:
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from Imu.pb.h:33:0,
from Imu.pb.cc:5:
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from Imu.pb.cc:5:0:
Imu.pb.h: In member function ‘const gazebo::msgs::Quaternion& sensor_msgs::msgs::Imu::orientation() const’:
Imu.pb.h:290:8: error: ‘_Quaternion_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Quaternion_default_instance_);
^
Imu.pb.h: In member function ‘const gazebo::msgs::Vector3d& sensor_msgs::msgs::Imu::angular_velocity() const’:
Imu.pb.h:366:8: error: ‘_Vector3d_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Vector3d_default_instance_);
^
Imu.pb.h: In member function ‘const gazebo::msgs::Vector3d& sensor_msgs::msgs::Imu::linear_acceleration() const’:
Imu.pb.h:442:8: error: ‘_Vector3d_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Vector3d_default_instance_);
^
Imu.pb.cc: In static member function ‘static void sensor_msgs::msgs::protobuf_Imu_2eproto::TableStruct::InitDefaultsImpl()’:
Imu.pb.cc:108:19: error: ‘gazebo::msgs::protobuf_quaternion_2eproto’ has not been declared
::gazebo::msgs::protobuf_quaternion_2eproto::InitDefaults();
^
Imu.pb.cc:109:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::InitDefaults();
^
Imu.pb.cc:113:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Quaternion’
::gazebo::msgs::Quaternion::internal_default_instance());
^
Imu.pb.cc:115:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
Imu.pb.cc:117:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
Imu.pb.cc: In function ‘void sensor_msgs::msgs::protobuf_Imu_2eproto::{anonymous}::AddDescriptorsImpl()’:
Imu.pb.cc:143:19: error: ‘gazebo::msgs::protobuf_quaternion_2eproto’ has not been declared
::gazebo::msgs::protobuf_quaternion_2eproto::AddDescriptors();
^
Imu.pb.cc:144:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::AddDescriptors();
^
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Dnav_msgs_EXPORTS -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/local/include -isystem /usr/include/sdformat-6.2 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usmake px4_sitl ger/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/csgurel/src/Firmware/Tools/sitl_gazebo/include -I. -I/usr/include/eigen3 -I/usr/include/eigen3/eigen3 -I/usr/include/gazebo-9/gazebo/msgs -I/home/csgurel/src/Firmware/mavlink/include -I/usr/include/Paging -isystem /opt/ros/kinetic/include/opencv-3.3.1-dev -isystem /opt/ros/kinetic/include/opencv-3.3.1-dev/opencv -I/home/csgurel/src/Firmware/Tools/sitl_gazebo/external/OpticalFlow/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/nav_msgs.dir/Odometry.pb.cc.o -MF CMakeFiles/nav_msgs.dir/Odometry.pb.cc.o.d -o CMakeFiles/nav_msgs.dir/Odometry.pb.cc.o -c Odometry.pb.cc
In file included from Odometry.pb.h:32:0,
from Odometry.pb.cc:5:
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from Odometry.pb.h:33:0,
from Odometry.pb.cc:5:
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-9/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from Odometry.pb.cc:5:0:
Odometry.pb.h: In member function ‘const gazebo::msgs::Vector3d& nav_msgs::msgs::Odometry::position() const’:
Odometry.pb.h:302:8: error: ‘_Vector3d_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Vector3d_default_instance_);
^
Odometry.pb.h: In member function ‘const gazebo::msgs::Quaternion& nav_msgs::msgs::Odometry::orientation() const’:
Odometry.pb.h:348:8: error: ‘_Quaternion_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Quaternion_default_instance_);
^
Odometry.pb.h: In member function ‘const gazebo::msgs::Vector3d& nav_msgs::msgs::Odometry::linear_velocity() const’:
Odometry.pb.h:394:8: error: ‘_Vector3d_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Vector3d_default_instance_);
^
Odometry.pb.h: In member function ‘const gazebo::msgs::Vector3d& nav_msgs::msgs::Odometry::angular_velocity() const’:
Odometry.pb.h:440:8: error: ‘_Vector3d_default_instance_’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::_Vector3d_default_instance_);
^
Odometry.pb.cc: In static member function ‘static void nav_msgs::msgs::protobuf_Odometry_2eproto::TableStruct::InitDefaultsImpl()’:
Odometry.pb.cc:106:19: error: ‘gazebo::msgs::protobuf_quaternion_2eproto’ has not been declared
::gazebo::msgs::protobuf_quaternion_2eproto::InitDefaults();
^
Odometry.pb.cc:107:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::InitDefaults();
^
Odometry.pb.cc:111:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
Odometry.pb.cc:113:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Quaternion’
::gazebo::msgs::Quaternion::internal_default_instance());
^
Odometry.pb.cc:115:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
Odometry.pb.cc:117:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
Odometry.pb.cc: In function ‘void nav_msgs::msgs::protobuf_Odometry_2eproto::{anonymous}::AddDescriptorsImpl()’:
Odometry.pb.cc:142:19: error: ‘gazebo::msgs::protobuf_quaternion_2eproto’ has not been declared
::gazebo::msgs::protobuf_quaternion_2eproto::AddDescriptors();
^
Odometry.pb.cc:143:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::AddDescriptors();
^
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.
Makefile:197: recipe for target 'px4_sitl' failed
make: *** [px4_sitl] Error 1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 42 (18 by maintainers)
I had finally solve this error . It was definitely a
libprotobuf
version error as the version that is needed to build isversion 3.0.0
and mine was detecting a upgarded version that was3.4.1
. As stated above one can check his version by runningprotoc --version
on your terminal. Thelibprotobuf
is actually installed in the directory/usr/local/include/google
. So, to installed the correct version first download the correct file from here protobuf-cpp-3.0.0.tar.gz . Into your Download folder. And then follow the steps that are listed on this link :http://answers.gazebosim.org/question/18096/this-file-was-generated-by-an-older-version-of-protoc/
NOTE : In the above link file you have downloaded their is no need of running
$ ./autogen.sh
as the required file are already downloaded in it .It is due to outdatedautogen.sh
file as listed here . And also when you run$ make check
it will return some error . But, you can ignore that as it run fine without that also. After that go to Your Firmware directory that you had cloned. And run$ make clean
$ make px4_sitl gazebo
Now, you are good to go. Hope, this help others