Issue #2496 resolved
pierre kancir created an issue

Hello,

I try to build an external plugin with gazebo9 on ubunut 8.04 form OSRF repo and it fails with many error like "/usr/include/ignition/msgs1/ignition/msgs/color.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" See log file attached

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04 LTS
Release:    18.04
Codename:   bionic
dpkg -l | grep gazebo9 
ii  gazebo9                                                          9.2.0-1~bionic                       amd64        Open Source Robotics Simulator
ii  gazebo9-common                                                   9.2.0-1~bionic                       all          Open Source Robotics Simulator - Shared files
ii  gazebo9-plugin-base                                              9.2.0-1~bionic                       amd64        Open Source Robotics Simulator - base plug-ins
ii  libgazebo9:amd64                                                 9.2.0-1~bionic                       amd64        Open Source Robotics Simulator - shared library
ii  libgazebo9-dev:amd64                                             9.2.0-1~bionic                       amd64        Open Source Robotics Simulator - Development Files
dpkg -l | grep protobuf                                                 2 ↵
ii  libmirprotobuf3:amd64                                            0.31.1-0ubuntu1                      amd64        Display server for Ubuntu - RPC definitions
ii  libprotobuf-dev:amd64                                            3.0.0-9.1ubuntu1                     amd64        protocol buffers C++ library (development files)
ii  libprotobuf-lite10:amd64                                         3.0.0-9.1ubuntu1                     amd64        protocol buffers C++ library (lite version)
ii  libprotobuf10:amd64                                              3.0.0-9.1ubuntu1                     amd64        protocol buffers C++ library
ii  protobuf-c-compiler                                              1.2.1-2                              amd64        Protocol Buffers C compiler (protobuf-c)
ii  protobuf-compiler                                                3.0.0-9.1ubuntu1                     amd64        compiler for protocol buffer definition files
ii  python3-protobuf                                                 3.0.0-9.1ubuntu1                     amd64        Python 3 bindings for protocol buffers

Comments (6)

  1. Jiří Kerner

    Hello,

    I am experiencing the same issue, but with a different system configuration. I will leave my notes on the issue here and if this is not a proper place, I will open new issue for it later.

    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.5 LTS
    Release:    16.04
    Codename:   xenial
    

    Today I upgraded Gazebo to version

    gazebo9/unknown,unknown,now 9.3.0-1~xenial amd64 [installed]
    

    After that in order to be able to compile Gazebo plugins, u installed libgazebo9-dev, that forced me to update libprotobuf-dev and protobuf-compiler from 2.6.1-1.3 to 3.1.0 I dont have a trace of the installation, but if I force downgrade of libprotobuf-dev, I get

    sudo apt install libprotobuf-dev=2.6.1-1.3
    The following packages will be REMOVED:
      libgazebo9-dev libignition-msgs-dev libignition-transport4-dev libprotoc-dev
    The following packages will be DOWNGRADED:
      libprotobuf-dev
    

    I think that while Gazebo 9.3.0 ( at least development package ) is configured to use Protobuf 3.1.0, package

    libignition-msgs/unknown,unknown,now 1.0.0-2~xenial amd64 [installed,automatic]
    

    was not updated for release of Gazebo 9.3.0 and that is what is causing these problems. Unfortunately I cannot tell if the case is that Gazebo 9.3.0 updated protobuf and ign-msgs are left behind, or the other way around.

  2. Jose Luis Rivero

    Hello:

    Opening the /usr/include/ignition/msgs1/ignition/msgs/color.pb.h file from package version 1.0.0+dfsg1-5 in my Bionic system it shows:

    // Generated by the protocol buffer compiler.  DO NOT EDIT!
    // source: ignition/msgs/color.proto
    
    #ifndef PROTOBUF_ignition_2fmsgs_2fcolor_2eproto__INCLUDED
    #define PROTOBUF_ignition_2fmsgs_2fcolor_2eproto__INCLUDED
    
    #include <string>
    
    #include <google/protobuf/stubs/common.h>
    
    #if GOOGLE_PROTOBUF_VERSION < 3000000
    #error This file was generated by a newer version of protoc which is
    #error incompatible with your Protocol Buffer headers.  Please update
    #error your headers.
    #endif
    #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
    #error This file was generated by an older version of protoc which is
    #error incompatible with your Protocol Buffer headers.  Please
    #error regenerate this file with a newer version of protoc.
    #endif
    

    It seems to be generated by protobuf3. Could you please post instructions about how could I reproduce your problems? Thanks.

  3. pierre kancir reporter

    Hello,

    I have double check and I get the same header than you. I revert back from ubuntu-proposed package, but I still get the error. I get the problem with those simple instructions :

    git clone https://github.com/khancyr/ardupilot_gazebo
    cd ardupilot_gazebo
    mkdir build
    cd build
    cmake ..
    make -j4
    

    Thanks

  4. pierre kancir reporter

    I found the issue. Because of the manual install of google-cartographer, protobuf3 was manually installed on my system. It overwrite system protobuf install and cannot be uninstall other than with make uninstall... Therefore I get the wrong protobuf compiler installed without knowing it...

    Sorry for the noise ... Gazebo is the only projet where I need protobuf, so I didn't notice that before. I release the error when the file got the right header and GOOGLE_PROTOBUF_VERSION was good in /usr/include/google/protobuf/stubs but the protoc --version return 3.4.0. And ubuntu 18.04 only install protoc 3.0.0 with apt install protobuf-complier.

    I am closing this.

  5. Log in to comment