The example.proto has been changed to proto3, and proto3 currently doesn't support lite runtime. You can try to change the syntax back to proto2 and see whether it works.
On Monday, November 23, 2015 at 10:04:04 AM UTC-8, Suvir Bhargav wrote: > > Hi, > > I managed to cross compile and test addressbook program for my target > platform i.e. arm. > However, when doing the same with lite library, it fails to compile. > > The example fails to compile for both x86 and arm. I read that the lite > version of the library omits some features but is that the case with > address book example as well? If that's the case, is there any example > around that works with protobuf-lite. Or is it the compilation step that is > missing something. Below is the error, same compiles fine for -lprotobuf > > machine@machine-VirtualBox:~/svn_branch_dev/protobuf_example/src$ > arm-linux-gnueabi-g++ add_person.cc addressbook.pb.cc -o > add_person_cpp_arm_static -static -pthread > -I/home/machine/svn_branch_dev/protobuf_example/ARMTarget/include -pthread > -L/home/machine/svn_branch_dev/protobuf_example/ARMTarget/lib/ > -lprotobuf-lite -lpthread > > > /tmp/ccSfec4t.o: In function `main': > add_person.cc:(.text+0x34e): undefined reference to > `google::protobuf::Message::ParseFromIstream(std::basic_istream<char, > std::char_traits<char> >*)' > add_person.cc:(.text+0x3f2): undefined reference to > `google::protobuf::Message::SerializeToOstream(std::basic_ostream<char, > std::char_traits<char> >*) const' > /tmp/ccqqsnlg.o: In function > `tutorial::protobuf_AssignDesc_addressbook_2eproto()': > addressbook.pb.cc:(.text+0xa): undefined reference to > `google::protobuf::DescriptorPool::generated_pool()' > addressbook.pb.cc:(.text+0x38): undefined reference to > `google::protobuf::DescriptorPool::FindFileByName(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&) const' > addressbook.pb.cc:(.text+0x100): undefined reference to > `google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(google::protobuf::Descriptor > > const*, google::protobuf::Message const*, int const*, int, int, int, int, > int, int)' > addressbook.pb.cc:(.text+0x174): undefined reference to > `google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(google::protobuf::Descriptor > > const*, google::protobuf::Message const*, int const*, int, int, int, int, > int, int)' > addressbook.pb.cc:(.text+0x1fe): undefined reference to > `google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(google::protobuf::Descriptor > > const*, google::protobuf::Message const*, int const*, int, int, int, int, > int, int)' > /tmp/ccqqsnlg.o: In function `tutorial::(anonymous > namespace)::protobuf_RegisterTypes(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&)': > addressbook.pb.cc:(.text+0x280): undefined reference to > `google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(google::protobuf::Descriptor > > const*, google::protobuf::Message const*)' > addressbook.pb.cc:(.text+0x298): undefined reference to > `google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(google::protobuf::Descriptor > > const*, google::protobuf::Message const*)' > addressbook.pb.cc:(.text+0x2b0): undefined reference to > `google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(google::protobuf::Descriptor > > const*, google::protobuf::Message const*)' > /tmp/ccqqsnlg.o: In function > `tutorial::protobuf_AddDesc_addressbook_2eproto()': > addressbook.pb.cc:(.text+0x420): undefined reference to > `google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, > int)' > addressbook.pb.cc:(.text+0x434): undefined reference to > `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char > const*, void (*)(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&))' > /tmp/ccqqsnlg.o: In function > `tutorial::Person_PhoneNumber::Person_PhoneNumber()': > addressbook.pb.cc:(.text+0x600): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function > `tutorial::Person_PhoneNumber::Person_PhoneNumber(tutorial::Person_PhoneNumber > > const&)': > addressbook.pb.cc:(.text+0x67a): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function > `tutorial::Person_PhoneNumber::~Person_PhoneNumber()': > addressbook.pb.cc:(.text+0x6ec): undefined reference to > `google::protobuf::Message::~Message()' > addressbook.pb.cc:(.text+0x722): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function > `tutorial::Person_PhoneNumber::MergeFrom(google::protobuf::Message const&)': > addressbook.pb.cc:(.text+0xe06): undefined reference to > `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message > const&, google::protobuf::Message*)' > /tmp/ccqqsnlg.o: In function `tutorial::Person::Person()': > addressbook.pb.cc:(.text+0x1120): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function `tutorial::Person::Person(tutorial::Person > const&)': > addressbook.pb.cc:(.text+0x11b2): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function `tutorial::Person::~Person()': > addressbook.pb.cc:(.text+0x1244): undefined reference to > `google::protobuf::Message::~Message()' > addressbook.pb.cc:(.text+0x1288): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function > `tutorial::Person::MergeFrom(google::protobuf::Message const&)': > addressbook.pb.cc:(.text+0x1f2a): undefined reference to > `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message > const&, google::protobuf::Message*)' > /tmp/ccqqsnlg.o: In function > `tutorial::AddressBook::AddressBook(tutorial::AddressBook const&)': > addressbook.pb.cc:(.text+0x232a): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function `tutorial::AddressBook::~AddressBook()': > addressbook.pb.cc:(.text+0x238c): undefined reference to > `google::protobuf::Message::~Message()' > addressbook.pb.cc:(.text+0x23c2): undefined reference to > `google::protobuf::Message::~Message()' > /tmp/ccqqsnlg.o: In function > `tutorial::AddressBook::MergeFrom(google::protobuf::Message const&)': > addressbook.pb.cc:(.text+0x2942): undefined reference to > `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message > const&, google::protobuf::Message*)' > /tmp/ccqqsnlg.o: In function `.LC18': > addressbook.pb.cc:(.rodata+0x4c8): undefined reference to > `google::protobuf::Message::GetTypeName() const' > addressbook.pb.cc:(.rodata+0x4e4): undefined reference to > `google::protobuf::Message::InitializationErrorString() const' > addressbook.pb.cc:(.rodata+0x4e8): undefined reference to > `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite > > const&)' > addressbook.pb.cc:(.rodata+0x508): undefined reference to > `google::protobuf::Message::DiscardUnknownFields()' > addressbook.pb.cc:(.rodata+0x50c): undefined reference to > `google::protobuf::Message::SpaceUsed() const' > addressbook.pb.cc:(.rodata+0x530): undefined reference to > `google::protobuf::Message::GetTypeName() const' > addressbook.pb.cc:(.rodata+0x54c): undefined reference to > `google::protobuf::Message::InitializationErrorString() const' > addressbook.pb.cc:(.rodata+0x550): undefined reference to > `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite > > const&)' > addressbook.pb.cc:(.rodata+0x570): undefined reference to > `google::protobuf::Message::DiscardUnknownFields()' > addressbook.pb.cc:(.rodata+0x574): undefined reference to > `google::protobuf::Message::SpaceUsed() const' > addressbook.pb.cc:(.rodata+0x598): undefined reference to > `google::protobuf::Message::GetTypeName() const' > addressbook.pb.cc:(.rodata+0x5b4): undefined reference to > `google::protobuf::Message::InitializationErrorString() const' > addressbook.pb.cc:(.rodata+0x5b8): undefined reference to > `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite > > const&)' > addressbook.pb.cc:(.rodata+0x5d8): undefined reference to > `google::protobuf::Message::DiscardUnknownFields()' > addressbook.pb.cc:(.rodata+0x5dc): undefined reference to > `google::protobuf::Message::SpaceUsed() const' > addressbook.pb.cc:(.rodata+0x5f4): undefined reference to `typeinfo for > google::protobuf::Message' > addressbook.pb.cc:(.rodata+0x61c): undefined reference to `typeinfo for > google::protobuf::Message' > addressbook.pb.cc:(.rodata+0x63c): undefined reference to `typeinfo for > google::protobuf::Message' > /tmp/ccqqsnlg.o: In function > `google::protobuf::internal::InternalMetadataWithArena::Container::~Container()': > addressbook.pb.cc:(.text._ZN6google8protobuf8internal25InternalMetadataWithArena9ContainerD2Ev[_ZN6google8protobuf8internal25InternalMetadataWithArena9ContainerD5Ev]+0xc): > > undefined reference to > `google::protobuf::UnknownFieldSet::~UnknownFieldSet()' > /tmp/ccqqsnlg.o: In function `google::protobuf::Message::Message()': > addressbook.pb.cc:(.text._ZN6google8protobuf7MessageC2Ev[_ZN6google8protobuf7MessageC5Ev]+0x24): > > undefined reference to `vtable for google::protobuf::Message' > /tmp/ccqqsnlg.o: In function > `google::protobuf::internal::InternalMetadataWithArena::Container::Container()': > addressbook.pb.cc:(.text._ZN6google8protobuf8internal25InternalMetadataWithArena9ContainerC2Ev[_ZN6google8protobuf8internal25InternalMetadataWithArena9ContainerC5Ev]+0xc): > > undefined reference to > `google::protobuf::UnknownFieldSet::UnknownFieldSet()' > /tmp/ccqqsnlg.o: In function `tutorial::Person_PhoneNumber const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::Person_PhoneNumber > > const>(google::protobuf::Message const*)': > addressbook.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN8tutorial18Person_PhoneNumberEEEPT_PKNS0_7MessageE[tutorial::Person_PhoneNumber > > const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::Person_PhoneNumber > > const>(google::protobuf::Message const*)]+0x20): undefined reference to > `typeinfo for google::protobuf::Message' > addressbook.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN8tutorial18Person_PhoneNumberEEEPT_PKNS0_7MessageE[tutorial::Person_PhoneNumber > > const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::Person_PhoneNumber > > const>(google::protobuf::Message const*)]+0x24): undefined reference to > `typeinfo for google::protobuf::Message' > /tmp/ccqqsnlg.o: In function `tutorial::Person const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::Person > const>(google::protobuf::Message const*)': > addressbook.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN8tutorial6PersonEEEPT_PKNS0_7MessageE[tutorial::Person > > const* google::protobuf::internal::DynamicCastToGenerated<tutorial::Person > const>(google::protobuf::Message const*)]+0x20): undefined reference to > `typeinfo for google::protobuf::Message' > addressbook.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN8tutorial6PersonEEEPT_PKNS0_7MessageE[tutorial::Person > > const* google::protobuf::internal::DynamicCastToGenerated<tutorial::Person > const>(google::protobuf::Message const*)]+0x24): undefined reference to > `typeinfo for google::protobuf::Message' > /tmp/ccqqsnlg.o: In function `tutorial::AddressBook const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::AddressBook > const>(google::protobuf::Message const*)': > addressbook.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN8tutorial11AddressBookEEEPT_PKNS0_7MessageE[tutorial::AddressBook > > const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::AddressBook > const>(google::protobuf::Message const*)]+0x20): undefined reference to > `typeinfo for google::protobuf::Message' > /tmp/ccqqsnlg.o:addressbook.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN8tutorial11AddressBookEEEPT_PKNS0_7MessageE[tutorial::AddressBook > > const* > google::protobuf::internal::DynamicCastToGenerated<tutorial::AddressBook > const>(google::protobuf::Message const*)]+0x24): more undefined references > to `typeinfo for google::protobuf::Message' follow > collect2: ld returned 1 exit status > > > > Thanks > Suvir > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
