cygwin中的Google协议缓冲区编译错误

cygwin中的Google协议缓冲区编译错误,cygwin,protocol-buffers,Cygwin,Protocol Buffers,我在cygwin上安装了protobuf并进行了测试(检查)。所有测试均成功。但是当我试图编译这个示例文件时,我得到了一个错误 /tmp/ccffZ4qk.o:add_person.cc:(.rdata$.refptr._ZN6google8protobuf8internal13empty_string_E[.refptr._ZN6google8protobuf8internal13empty_string_E]+0x0): undefined reference to `google::pro

我在cygwin上安装了protobuf并进行了测试(检查)。所有测试均成功。但是当我试图编译这个示例文件时,我得到了一个错误

/tmp/ccffZ4qk.o:add_person.cc:(.rdata$.refptr._ZN6google8protobuf8internal13empty_string_E[.refptr._ZN6google8protobuf8internal13empty_string_E]+0x0): undefined reference to `google::protobuf::internal::empty_string_'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0xee3): undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0xee3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x1060): undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x1060): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x22f7): undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x22f7): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x2385): undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x2385): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x253d): undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x253d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x2739): undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text+0x2739): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text$_ZN6google8protobuf8internal10WireFormat26VerifyUTF8StringNamedFieldEPKciNS2_9OperationES4_[_ZN6google8protobuf8internal10WireFormat26VerifyUTF8StringNamedFieldEPKciNS2_9OperationES4_]+0x2e): undefined reference to `google::protobuf::internal::WireFormat::VerifyUTF8StringFallback(char const*, int, google::protobuf::internal::WireFormat::Operation, char const*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.text$_ZN6google8protobuf8internal10WireFormat26VerifyUTF8StringNamedFieldEPKciNS2_9OperationES4_[_ZN6google8protobuf8internal10WireFormat26VerifyUTF8StringNamedFieldEPKciNS2_9OperationES4_]+0x2e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `google::protobuf::internal::WireFormat::VerifyUTF8StringFallback(char const*, int, google::protobuf::internal::WireFormat::Operation, char const*)'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.rdata$.refptr._ZN6google8protobuf8internal23empty_string_once_init_E[.refptr._ZN6google8protobuf8internal23empty_string_once_init_E]+0x0): undefined reference to `google::protobuf::internal::empty_string_once_init_'
/tmp/ccJpLpoK.o:addressbook.pb.cc:(.rdata$.refptr._ZN6google8protobuf8internal15InitEmptyStringEv[.refptr._ZN6google8protobuf8internal15InitEmptyStringEv]+0x0): undefined reference to `google::protobuf::internal::InitEmptyString()'

请帮帮我

您可能没有链接protobuf库。您需要将
-lprotobuf
传递给编译器。(如果您还没有安装,您可能应该首先进行安装。

您可能没有链接protobuf库。您需要将
-lprotobuf
传递给编译器。(如果您还没有安装,您可能应该先进行安装。)