nilseuropa / gazebo_ros_motors

Motor simulation plugins for Gazebo - ROS
116 stars 26 forks source link

Compilation failed #5

Closed fengwh123 closed 4 years ago

fengwh123 commented 4 years ago

Hi, I want to use your plugin in my project, but during the process of compiling this package in my workspace, the following error occurred:

In file included from /usr/include/ignition/msgs0/ignition/msgs/MessageTypes.hh:116:0,
                 from /usr/include/ignition/msgs0/ignition/msgs.hh:3,
                 from /usr/include/ignition/transport3/ignition/transport/Node.hh:32,
                 from /usr/include/gazebo-8/gazebo/physics/Entity.hh:25,
                 from /usr/include/gazebo-8/gazebo/physics/Model.hh:30,
                 from /usr/include/gazebo-8/gazebo/physics/Actor.hh:24,
                 from /usr/include/gazebo-8/gazebo/physics/physics.hh:2,
                 from /home/elaine/FWH/RoverSim_ws/src/gazebo_ros_motors/include/gazebo_ros_joint_motor/gazebo_ros_joint_motor.h:8,
                 from /home/elaine/FWH/RoverSim_ws/src/gazebo_ros_motors/src/gazebo_ros_joint_motor.cpp:7:
/usr/include/ignition/msgs0/ignition/msgs/sim_event.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/ignition/msgs0/ignition/msgs/selection.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^
/usr/include/ignition/msgs0/ignition/msgs/sim_event.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^
/usr/include/ignition/msgs0/ignition/msgs/selection.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.
  ^
/usr/include/ignition/msgs0/ignition/msgs/sim_event.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.
  ^

It can be seen that there seems to be a problem with the protoc version. The protoc version required to execute the compilation is 2.6.1, while the version installed on my computer is 2.6.1 indeed. I don't know if there is a problem with the environment configuration. The version of ROS is kinetic and the version of Gazebo is 8.6 on Ubuntu 16.04. The question is, what is your version of ROS and Gazebo, have you encountered this problem before, and is there a corresponding solution? I hope you can help me. Thanks in advance.

nilseuropa commented 4 years ago

Hi,

have you tried the kinetic branch?

fengwh123 commented 4 years ago

@nilseuropa I tried the kinetic branch just now, and the same error occurred during compilation. Therefore, do you have a corresponding solution? Thanks.

Gyebro commented 4 years ago

Hi @fengwh123, this problem might occur if you have multiple protoc installations. What does protoc --version say on your computer? If you look into one of the auto-generated ph.h files, (say /usr/include/ignition/msgs0/ignition/msgs/sim_event.pb.h) what's the hard-coded version there? In some cases removing the non-gazebo version protoc from your PATH can solve this error.

fengwh123 commented 4 years ago

Hi @Gyebro, Thanks for your suggestion, this error has been solved. Thank you very much.