Yeah, it appears you aren't linking against the protobuf runtime. Did you set up eclipse to build from the makefile in the examples directory?
On Thu, Jun 23, 2011 at 8:46 AM, Enrico Viappiani <[email protected]>wrote: > I've installed protobuf 2.4.1 on ubuntu, running configure,make, make > check and make install, and everything seems fine. > Then I've tried to compile the examples code in the packet, "make > cpp" , I've obtained the .cc and .h from the .proto file. > In Eclipse CDT, I've imported those 2 files, along with the other > 2 .cc sources,list_people.cc and add_person.cc ; > In the included libraries I've both /usr/local/include and /usr/local/ > lib. > But doesn't build at all because of tons of errors like this: > > ... > (google::protobuf::MessageLite const&)' > ./addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable > for tutorial::Person_PhoneNumber]+0x88): undefined reference to > `google::protobuf::Message::DiscardUnknownFields()' > ./addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable > for tutorial::Person_PhoneNumber]+0x90): undefined reference to > `google::protobuf::Message::SpaceUsed() const' > ./addressbook.pb.o:(.rodata._ZTIN8tutorial11AddressBookE[typeinfo for > tutorial::AddressBook]+0x10): undefined reference to `typeinfo for > google::protobuf::Message' > ./addressbook.pb.o:(.rodata._ZTIN8tutorial6PersonE[typeinfo for > tutorial::Person]+0x10): undefined reference to `typeinfo for > google::protobuf::Message' > ./addressbook.pb.o: > (.rodata._ZTIN8tutorial18Person_PhoneNumberE[typeinfo for > tutorial::Person_PhoneNumber]+0x10): undefined reference to `typeinfo > for google::protobuf::Message' > ./list_people.o: In function `main': > list_people.cc:(.text+0x1ed): undefined reference to > `google::protobuf::internal::VerifyVersion(int, int, char const*)' > list_people.cc:(.text+0x297): undefined reference to > `google::protobuf::Message::ParseFromIstream(std::basic_istream<char, > std::char_traits<char> >*)' > list_people.cc:(.text+0x313): undefined reference to > `google::protobuf::ShutdownProtobufLibrary()' > .. > > even on the macro GOOGLE_VERIFY_VERSION i get "undefined reference to > `google::protobuf::internal::VerifyVersion(int, int, char const*)' " > > I believe that is a linking problem, but I'm not sure.. > > I'm really confused.. and I don't know really how to check my > installation.. > > some Ideas? > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
