Linking error with protobuf 2.6.1 while building ignition-messages0 on ubuntu 16.04

23 views
Skip to first unread message

rishabh lal

unread,
Jul 9, 2019, 4:45:37 AM7/9/19
to Protocol Buffers
I am trying to build ign-msgs (version 0) from source which is a dependency for ignition transport 2 and gazebo 7. I installed protobuf from ubuntu repos and downloaded ign-msgs0 from bitbucket. 

The compilation &/or linking error I am facing is :-

Linking CXX executable ign_msgs_gen
CMakeFiles/ign_msgs_gen.dir/Generator.cc.o: In function `google::protobuf::compiler::cpp::Generator::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/ign-msgs-0/src/Generator.cc:84: undefined reference to `google::protobuf::io::Printer::Print(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/deadmanlogan/i_am_from_source/ign-msgs-0/src/Generator.cc:85: undefined reference to `google::protobuf::io::Printer::Print(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/deadmanlogan/i_am_from_source/ign-msgs-0/src/Generator.cc:86: undefined reference to `google::protobuf::io::Printer::Print(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/deadmanlogan/i_am_from_source/ign-msgs-0/src/Generator.cc:88: undefined reference to `google::protobuf::io::Printer::Print(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/deadmanlogan/i_am_from_source/ign-msgs-0/src/Generator.cc:89: undefined reference to `google::protobuf::io::Printer::Print(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/ign_msgs_gen.dir/Generator.cc.o:/home/deadmanlogan/i_am_from_source/ign-msgs-0/src/Generator.cc:90: more undefined references to `google::protobuf::io::Printer::Print(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow
collect2: error: ld returned 1 exit status
src/CMakeFiles/ign_msgs_gen.dir/build.make:102: recipe for target 'src/ign_msgs_gen' failed
make[2]: *** [src/ign_msgs_gen] Error 1
CMakeFiles/Makefile2:343: recipe for target 'src/CMakeFiles/ign_msgs_gen.dir/all' failed
make[1]: *** [src/CMakeFiles/ign_msgs_gen.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

 link for ign-msgs0 tarball 

Please shine some light on this issue.
Build_output

Adam Cozzette

unread,
Jul 9, 2019, 4:22:56 PM7/9/19
to rishabh lal, Protocol Buffers
I suspect this is a C++11 ABI compatibility issue. It looks like ign-msgs is being built for C++11 but libprotobuf as packaged by Ubuntu was likely built for C++03.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/e1a100c7-568a-4a0a-88ed-f17aad75c045%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rishabh lal

unread,
Jul 11, 2019, 1:55:42 PM7/11/19
to Protocol Buffers
Solved this by linking with protobuf 3.7, just linked in cmakelists.txt , Generator.cc with "protobuf::libprotoc protobuf::libprotobuf".
Reply all
Reply to author
Forward
0 new messages