Gazebo | Ignition | Community
Ask Your Question

This file was generated by an older version of protoc

asked 2017-12-13 08:27:01 -0500

l1va gravatar image

Running Ubuntu 16.04 and Gazebo 7. All works ok but then i installed cartographer.

As you can see from installation script (https://google-cartographer-ros.readt...) it installs protoc 3.4.1. And now my project can not be build:

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

I tried to install gazebo from source, but got another(seems related) problem:

/usr/local/lib/libprotoc.a( In function `google::protobuf::compiler::GeneratorContext::GetCompilerVersion(google::protobuf::compiler::Version*) const': undefined reference to `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]'
/usr/local/lib/libprotoc.a( In function `google::protobuf::compiler::ParseGeneratorParameter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >*)': undefined reference to `google::protobuf::SplitStringUsing(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)'
/usr/local/lib/libprotoc.a( In function `google::protobuf::compiler::GenerateCode(google::protobuf::compiler::CodeGeneratorRequest const&, google::protobuf::compiler::CodeGenerator const&, google::protobuf::compiler::CodeGeneratorResponse*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)': undefined reference to `google::protobuf::DescriptorPool::DescriptorPool()'.........

ps. yes, the problem is old (, but i can not find solution - i want to use both gazebo and cartographer (or at least repaire gazebo).

Does gazebo can be build with protoc 3.4.1 ? How to do that? Or at least how to remove protoc 3.4 and how to work with cartographer? Many thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-31 03:40:18 -0500

MBD gravatar image

updated 2018-09-12 03:05:32 -0500

I've come across to the same problem. I'm using Ubuntu 16.04, ROS Kinetic and Gazebo 7.0.

First, be sure that you're using the protoc with a version above 2.6.1. Gazebo 7 works along with the protoc-2.6.1. You can learn the version of the protoc installed on your system with $ protoc --version command. It was 3.2.0 in my system. Thus this solution replaces the protobuf installed on your system with the version 2.6.1.

I solved the problem via using the following instructions.

  1. $ cd /usr/local/include/google
  2. sudo rm -rf protobuf
  3. Go, download protobuf-2.6.1 from here and extract the contents. (I downloaded protobuf-2.6.1.tar.gz)
  4. I followed the installation instructions given here. Which are:

    $ ./

    $ ./configure

    $ make

    $ make check

    $ sudo make install

    $ sudo ldconfig

  5. Right now I'm able to compile my workspace without a problem.

edit flag offensive delete link more


Thank you! This worked for me aswell! Saved me a good chunk of time! :D

Bogga gravatar imageBogga ( 2018-11-14 12:58:14 -0500 )edit

Thanks, it worked for me. For those who are facing similar problems with gazebo 9 should use protobuf-3.0.0 instead from here. Also in my case protobuf was in /usr/include/google so make sure to check there.

RoboManiac gravatar imageRoboManiac ( 2020-07-06 06:48:38 -0500 )edit

Thanks! It worked for me!

Yuuubc gravatar imageYuuubc ( 2021-01-16 06:47:35 -0500 )edit

Thanks, and relatedly: For future reference, in case of having cartographer's system wide protoc/protobuf install:

HarshalDawar gravatar imageHarshalDawar ( 2022-01-25 12:19:21 -0500 )edit

answered 2017-12-13 10:13:52 -0500

sloretz gravatar image

Gazebo is built against the version of protoc released to the ubuntu repos. On 16.04 that version is 2.6.1.

There is no guarantee it will work using the newer protobuf version, but you can try building gazebo from source following this tutorial:

The cartographer instructions install protobuf system wide using the script here: . If building gazebo from source doesn't work then I recommend opening an issue on the cartographer repo asking how to build and run it without installing proto3 system wide.

edit flag offensive delete link more


Thanks for the answer. I know these all and tried installing from source as i wrote - is not working. Yes, i asked to help cartographer guys too, by commits - seems not so long time ago cartographer used protoc2.

l1va gravatar imagel1va ( 2017-12-13 10:36:33 -0500 )edit

I met the same problem. Have you find any solution?

lianghu3124 gravatar imagelianghu3124 ( 2018-08-30 01:47:53 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-12-13 07:56:05 -0500

Seen: 16,274 times

Last updated: Sep 12 '18