Home | Tutorials | Wiki | Issues
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/animate_pose.cc:4:
/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(code_generator.cc.o): In function `google::protobuf::compiler::GeneratorContext::GetCompilerVersion(google::protobuf::compiler::Version*) const':
code_generator.cc:(.text+0x4e5): undefined reference to `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]'
/usr/local/lib/libprotoc.a(code_generator.cc.o): 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> > > > >*)':
code_generator.cc:(.text+0x5fd): 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(plugin.cc.o): 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> >*)':
plugin.cc:(.text+0x38): undefined reference to `google::protobuf::DescriptorPool::DescriptorPool()'.........

ps. yes, the problem is old (http://answers.gazebosim.org/question...), 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

1 Answer

Sort by ยป oldest newest most voted

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: http://gazebosim.org/tutorials?tut=in...

The cartographer instructions install protobuf system wide using the script here: https://github.com/googlecartographer... . 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
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 1,526 times

Last updated: Dec 13 '17