Ich habe ein Problem beim Verknüpfen der Protobuf-Bibliothek.C++ Protobuf Fehler google :: protobuf :: internal :: kEmptyString Fehler
/tmp/ccKgczB9.o:TickData.pb.cc:(.text+0x444): undefined reference to
google::protobuf::internal::kEmptyString' /tmp/ccKgczB9.o:TickData.pb.cc:(.text+0x4a9): undefined reference to
google::protobuf::internal::kEmptyString' /tmp/ccKgczB9.o:TickData.pb.cc:(.text+0x4c4): undefined reference togoogle::protobuf::internal::kEmptyString' /tmp/ccKgczB9.o:TickData.pb.cc:(.text+0x4de): undefined reference to
google::protobuf::internal::kEmptyString' /tmp/ccKgczB9.o:TickData.pb.cc:(.text+0x502): undefined reference togoogle::protobuf::internal::kEmptyString' /tmp/ccKgczB9.o:TickData.pb.cc:(.text+0x53c): more undefined references to
google::protobuf::internal::kEmptyString' follow /tmp/ccKgczB9.o:TickData.pb.cc:(.text$_ZN6google8protobuf8internal10WireFormat16VerifyUTF8StringEPKciNS2_9OperationE[__ZN6google8protobuf8internal10WireFormat16VerifyUTF8StringEPKciNS2_9OperationE]+0x1b): undefined reference to `google::protobuf::internal::WireFormat::VerifyUTF8StringFallback(char const*, int, google::protobuf::internal::WireFormat::Operation)' collect2: error: ld returned 1 exit status
sprachausstattungt: C++ Protobuf Version: 2.6.1
Ich habe schon Sachen auf Links unten, versucht, aber es funktioniert nicht aus:
Can't compile example from google protocol buffers
und
Undefined reference to google::protobuf::internal::empty_string_[abi:cxx11]
Ich bin neu in C++. Ich habe auch versucht, den Protobuf mit -std = C++ 11 zu kompilieren, aber immer noch den gleichen Fehler.
Alle Hinweise sind hilfreich.
Bitte zeigen Sie den Compiler-Befehlszeile Sie verwendet haben. (Meine Vermutung ist, dass es die Markierung "-lprotobuf" fehlt.) –
g ++ -g -L "/cygdrive/d/Softwares/protobuf-2.6.1/src/.libs" ../proto/TickData.pb. cc main.cpp -std = C++ 11 -lprotobuf – Abhishek