我在乌乌恩图将C++与阿帕塔纳作为我的教育、教育、科学和技术研究所一起使用。
I compiled the addressbook.proto file as follows:
protoc -I=/home/workspace/rtb/src/ --cpp_out=/home/workspace/rtb/src/ /home/workspace/rtb/src/addressbook.proto
我随后将产出标题档案列入我的++代码如下:
#include "addressbook.pb.h"
这应该是这样。 权利?
当我建造时...... 我收到一份错误清单,该清单太长。 下面是最后一行。 我失踪了什么? 我如何在++中利用假缓冲?
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial11AddressBookE[vtable for tutorial::AddressBook]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial11AddressBookE[vtable for tutorial::AddressBook]+0x48): undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial11AddressBookE[vtable for tutorial::AddressBook]+0x88): undefined reference to `google::protobuf::Message::DiscardUnknownFields()
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial11AddressBookE[vtable for tutorial::AddressBook]+0x90): undefined reference to `google::protobuf::Message::SpaceUsed() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial6PersonE[vtable for tutorial::Person]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial6PersonE[vtable for tutorial::Person]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial6PersonE[vtable for tutorial::Person]+0x48): undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial6PersonE[vtable for tutorial::Person]+0x88): undefined reference to `google::protobuf::Message::DiscardUnknownFields()
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial6PersonE[vtable for tutorial::Person]+0x90): undefined reference to `google::protobuf::Message::SpaceUsed() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable for tutorial::Person_PhoneNumber]+0x20): undefined reference to `google::protobuf::Message::GetTypeName() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable for tutorial::Person_PhoneNumber]+0x40): undefined reference to `google::protobuf::Message::InitializationErrorString() const
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable for tutorial::Person_PhoneNumber]+0x48): undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable for tutorial::Person_PhoneNumber]+0x88): undefined reference to `google::protobuf::Message::DiscardUnknownFields()
./src/addressbook.pb.o:(.rodata._ZTVN8tutorial18Person_PhoneNumberE[vtable for tutorial::Person_PhoneNumber]+0x90): undefined reference to `google::protobuf::Message::SpaceUsed() const
./src/addressbook.pb.o:(.rodata._ZTIN8tutorial11AddressBookE[typeinfo for tutorial::AddressBook]+0x10): undefined reference to `typeinfo for google::protobuf::Message
./src/addressbook.pb.o:(.rodata._ZTIN8tutorial6PersonE[typeinfo for tutorial::Person]+0x10): undefined reference to `typeinfo for google::protobuf::Message
./src/addressbook.pb.o:(.rodata._ZTIN8tutorial18Person_PhoneNumberE[typeinfo for tutorial::Person_PhoneNumber]+0x10): undefined reference to `typeinfo for google::protobuf::Message
collect2: ld returned 1 exit status
make: *** [rtb] Error 1