Home | Tutorials | Wiki | Issues
Ask Your Question
0

Linking error with protobuf 3.7 while building gazebo 7 on ubuntu 16.04

asked 2019-07-03 07:37:16 -0500

Rishabh6900 gravatar image

updated 2019-07-03 08:22:46 -0500

kumpakri gravatar image

I am trying to install gazebo 7 from source on ubuntu 16.04 and while compiling it gives error regarding “undefined reference” to 'google::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'

Specifically speaking i get the following error:-

CMakeFiles/gazebomsgs_out.dir/generator/GazeboGenerator.cc.o: In function google::protobuf::compiler::cpp::GazeboGenerator::~GazeboGenerator()': /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:38: undefined reference togoogle::protobuf::compiler::CodeGenerator::~CodeGenerator()'
CMakeFiles/gazebomsgs_out.dir/generator/GazeboGenerator.cc.o: In function google::protobuf::compiler::cpp::GazeboGenerator::Generate(google::protobuf::FileDescriptor const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::compiler::GeneratorContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const': /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:55: undefined reference togoogle::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:55: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:65: undefined reference togoogle::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:65: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:76: undefined reference togoogle::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:76: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:89: undefined reference togoogle::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:89: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:106: undefined reference togoogle::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:106: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:123: undefined reference togoogle::protobuf::io::Printer::Printer(google::protobuf::io::ZeroCopyOutputStream*, char)'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:123: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:55: undefined reference togoogle::protobuf::io::Printer::~Printer()'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:65: undefined reference to google::protobuf::io::Printer::~Printer()' /home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:76: undefined reference togoogle::protobuf::io::Printer::~Printer()'
/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:89: undefined reference to google::protobuf::io::Printer::~Printer()' CMakeFiles/gazebomsgs_out.dir/generator/GazeboGenerator.cc.o:/home/deadmanlogan/i_am_from_source/gazebo_7/gazebo/msgs/generator/GazeboGenerator.cc:106: more undefined references togoogle::protobuf::io::Printer::~Printer()' follow
CMakeFiles/gazebomsgs_out.dir/generator/GazeboGenerator.cc.o: In function google::protobuf::compiler::CodeGenerator::CodeGenerator()': /usr/local/include/google/protobuf/compiler/code_generator.h:68: undefined reference tovtable for google::protobuf::compiler::CodeGenerator'
CMakeFiles/gazebomsgs_out.dir/generator/GazeboGenerator.cc.o: In function google::protobuf::io::Printer::PrintInternal(std::map ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-07-07 04:39:35 -0500

Rishabh6900 gravatar image

For now i have linked gazebo 7 with protobuf 2.6.1 (build from source) and the whole linking error is reduced to :-

[ 3%] Linking CXX executable gazebomsgs_out CMakeFiles/gazebomsgs_out.dir/generator/GazeboGenerator.cc.o:(.data.rel.ro._ZTVN6google8protobuf8compiler3cpp15GazeboGeneratorE[_ZTVN6google8protobuf8compiler3cpp15GazeboGeneratorE]+0x28): undefined reference to `google::protobuf::compiler::CodeGenerator::GenerateAll(std::vector<google::protobuf::filedescriptor const*,="" std::allocator<google::protobuf::filedescriptor="" const*=""> > const&, std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, google::protobuf::compiler::GeneratorContext, std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >) const' collect2: error: ld returned 1 exit status gazebo/msgs/CMakeFiles/gazebomsgs_out.dir/build.make:100: recipe for target 'gazebo/msgs/gazebomsgs_out' failed make[2]: * [gazebo/msgs/gazebomsgs_out] Error 1 CMakeFiles/Makefile2:914: recipe for target 'gazebo/msgs/CMakeFiles/gazebomsgs_out.dir/all' failed make[1]: [gazebo/msgs/CMakeFiles/gazebomsgs_out.dir/all] Error 2 make[1]: ** Waiting for unfinished jobs....

This “.data.rel.ro” error was also present in the beginning of this issue, if anybody could advice me anything about it then kindly share with me.

Thanks.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-07-03 07:37:16 -0500

Seen: 67 times

Last updated: Jul 07