ubuntu20.04下出现protoc与gazebo版本问题

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

ubuntu20+protoc+gazebo

问题描述

  今天在搞路径规划算法时从git上拉下来一个算法ros环境那些都有但是在编译的时候出现了如下图所示的一下问题为了方便搜索关键词

    In file included from /usr/include/gazebo11/gazebo/msgs/MessageTypes.hh:91:0,
                 from /usr/include/gazebo11/gazebo/msgs/msgs.hh:24,
                 from /usr/include/gazebo11/gazebo/physics/Entity.hh:28,
                 from /usr/include/gazebo11/gazebo/physics/Model.hh:32,
                 from /home/thesis/gazebo_animate_pose/animate_pose.cc:4:
/usr/include/gazebo11/gazebo/msgs/wrench_stamped.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
/usr/include/gazebo11/gazebo/msgs/wrench_stamped.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
/usr/include/gazebo11/gazebo/msgs/wrench_stamped.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.

请添加图片描述

问题定位

   通过错误描述我就开始对我现有的版本就行确认通过文件名称我确定gazebo版本是11
通过下方命令进行确认

dpkg -l | grep gazebo

protoc版本排查(我的版本是3.21.4)

protoc --version

  然后进入**/usr/include/gazebo-11/gazebo/msgs**路径下全局搜索关键字GOOGLE_PROTOBUF_VERSION随便进去一个文件就可以看到如下图内容
请添加图片描述

  我的protoc版本需求是** 3.6.1**所以就是protoc降级问题。

解决方案

  1. 下载3.6.1版本的安装包protobuf-all-3.6.1.tar.gz
  2. 解压并进入压缩包
  3. ./configure –prefix=/usr/local/
  4. sudo make
  5. sudo make check
  6. sudo make install
  7. protoc --version 查看最终的版本
    在这里插入图片描述
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: Ubuntu