Makefile:147: recipe for target 'posix_sitl_default' failed

#1

I am trying to run PX4 SITL and gazebo using following command but I am getting errors while I can run PX4 SITL with jmavsim.

make posix_sitl_default gazebo 


FAILED: /usr/bin/c++   -Dmav_msgs_EXPORTS -isystem /usr/include/gazebo-7 -isystem /usr/include/sdformat-4.4 -isystem /usr/include/ignition/math2 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -I/home/yograj/src/Firmware/Tools/sitl_gazebo/include -I/home/yograj/src/Firmware/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-7/gazebo/msgs -I/usr/include/eigen3 -isystem /opt/ros/kinetic/include/opencv-3.3.1 -isystem /opt/ros/kinetic/include/opencv-3.3.1/opencv -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/opt/ros/kinetic/include -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -MMD -MT CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o -MF CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o.d -o CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o -c SensorImu.pb.cc
In file included from SensorImu.pb.cc:5:0:
SensorImu.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
SensorImu.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
SensorImu.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from SensorImu.pb.cc:5:0:
SensorImu.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
FAILED: /usr/bin/c++   -Dmav_msgs_EXPORTS -isystem /usr/include/gazebo-7 -isystem /usr/include/sdformat-4.4 -isystem /usr/include/ignition/math2 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -I/home/yograj/src/Firmware/Tools/sitl_gazebo/include -I/home/yograj/src/Firmware/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-7/gazebo/msgs -I/usr/include/eigen3 -isystem /opt/ros/kinetic/include/opencv-3.3.1 -isystem /opt/ros/kinetic/include/opencv-3.3.1/opencv -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/opt/ros/kinetic/include -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -MMD -MT CMakeFiles/mav_msgs.dir/Float.pb.cc.o -MF CMakeFiles/mav_msgs.dir/Float.pb.cc.o.d -o CMakeFiles/mav_msgs.dir/Float.pb.cc.o -c Float.pb.cc
In file included from Float.pb.cc:5:0:
Float.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
Float.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
Float.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
In file included from Float.pb.cc:5:0:
Float.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.
Makefile:147: recipe for target 'posix_sitl_default' failed
make: *** [posix_sitl_default] Error 1
#2

Did you find a solution for this issue?

#3

No. I have to install everything from beginning in another system

#4

I have pin pointed the error where the sitl uses libprotoc-dev 2.6.1 in contrast to what my system is using is 3.3.1

#5

I tried to update protocol buff version but It is not using update version and giving same error.