2017-02-12 13 views
2

Недавно я установил последнюю версию Ubuntu (16) для разработки на C++. Когда я попытался включить «Google протокола буферов» в соответствии с инструкциями, которые можно найти здесь: https://github.com/google/protobuf/blob/master/src/README.md ->Google Protobuf 3: Неопределенные ошибки ссылки при создании с помощью CMAKE

$ sudo apt-get install autoconf automake libtool curl make g++ unzip 
$ ./autogen.sh 
$ ./configure 
$ make 
$ make check 
$ sudo make install 
$ sudo ldconfig # refresh shared library cache. 

Typing следующую команду делает выходные правильные результаты, поэтому установка ГПБ в порядке, не Это?

> protoc --version 
libprotoc 3.2.0 

Но когда я пытаюсь построить мое приложение с помощью CMake ->

cmake .. && make 
client 
/home/manuel/Schreibtisch/Repositories/Projekt/maurer/src/main.cpp/home/manuel/Schreibtisch/Repositories/Projekt/maurer/include/TerminalColors.h/home/manuel/Schreibtisch/Repositories/Projekt/maurer/include/Functions.h/home/manuel/Schreibtisch/Repositories/Projekt/maurer/include/URL.h 
-- Configuring done 
-- Generating done 
-- Build files have been written to: /home/manuel/Schreibtisch/Repositories/Projekt/maurer/build 
[ 25%] Linking CXX executable client 
CMakeFiles/client.dir/src/main.cpp.o: In Funktion `main': 
main.cpp:(.text+0x5a8b): Nicht definierter Verweis auf `google::protobuf::internal::VerifyVersion(int, int, char const*)' 
main.cpp:(.text+0x5b10): Nicht definierter Verweis auf `google::protobuf::Message::SerializeToOstream(std::ostream*) const' 
main.cpp:(.text+0x5bd0): Nicht definierter Verweis auf `google::protobuf::Message::ParseFromIstream(std::istream*)' 
main.cpp:(.text+0x5cf0): Nicht definierter Verweis auf `google::protobuf::ShutdownProtobufLibrary()' 
CMakeFiles/client.dir/src/main.cpp.o: In Funktion `google::protobuf::internal::GetEmptyStringAlreadyInited[abi:cxx11]()': 
main.cpp:(.text._ZN6google8protobuf8internal27GetEmptyStringAlreadyInitedB5cxx11Ev[_ZN6google8protobuf8internal27GetEmptyStringAlreadyInitedB5cxx11Ev]+0x5): Nicht definierter Verweis auf `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::protobuf_person_2eproto::(anonymous namespace)::protobuf_AssignDescriptors()': 
person.pb.cc:(.text+0x6e): Nicht definierter Verweis auf `google::protobuf::internal::AssignDescriptors(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::protobuf_person_2eproto::(anonymous namespace)::protobuf_RegisterTypes(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&)': 
person.pb.cc:(.text+0x108): Nicht definierter Verweis auf `google::protobuf::internal::RegisterAllTypes(google::protobuf::Metadata const*, int)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::protobuf_person_2eproto::TableStruct::InitDefaultsImpl()': 
person.pb.cc:(.text+0x15e): Nicht definierter Verweis auf `google::protobuf::internal::VerifyVersion(int, int, char const*)' 
person.pb.cc:(.text+0x163): Nicht definierter Verweis auf `google::protobuf::internal::InitProtobufDefaults()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::protobuf_person_2eproto::AddDescriptorsImpl()': 
person.pb.cc:(.text+0x19e): Nicht definierter Verweis auf `google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int)' 
person.pb.cc:(.text+0x1ad): Nicht definierter Verweis auf `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&))' 
person.pb.cc:(.text+0x1b7): Nicht definierter Verweis auf `google::protobuf::internal::OnShutdown(void (*)())' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person::Person(test::Person const&)': 
person.pb.cc:(.text+0x3a6): Nicht definierter Verweis auf `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const*, google::protobuf::internal::ArenaStringPtr)' 
person.pb.cc:(.text+0x402): Nicht definierter Verweis auf `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const*, google::protobuf::internal::ArenaStringPtr)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': 
person.pb.cc:(.text+0x830): Nicht definierter Verweis auf `google::protobuf::io::CodedInputStream::ReadTagFallback(unsigned int)' 
person.pb.cc:(.text+0x90a): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)' 
person.pb.cc:(.text+0x9ce): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)' 
person.pb.cc:(.text+0xa1d): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::SkipField(google::protobuf::io::CodedInputStream*, unsigned int)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const': 
person.pb.cc:(.text+0xadb): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)' 
person.pb.cc:(.text+0xafe): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&, google::protobuf::io::CodedOutputStream*)' 
person.pb.cc:(.text+0xb34): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::WriteInt32(int, int, google::protobuf::io::CodedOutputStream*)' 
person.pb.cc:(.text+0xb90): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)' 
person.pb.cc:(.text+0xbb3): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&, google::protobuf::io::CodedOutputStream*)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person::InternalSerializeWithCachedSizesToArray(bool, unsigned char*) const': 
person.pb.cc:(.text+0xc2e): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)' 
person.pb.cc:(.text+0xceb): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person::MergeFrom(google::protobuf::Message const&)': 
person.pb.cc:(.text+0xe48): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' 
person.pb.cc:(.text+0xe5e): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::operator<<(char const*)' 
person.pb.cc:(.text+0xe76): Nicht definierter Verweis auf `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' 
person.pb.cc:(.text+0xe8a): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::~LogMessage()' 
person.pb.cc:(.text+0xeb7): Nicht definierter Verweis auf `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message const&, google::protobuf::Message*)' 
person.pb.cc:(.text+0xee5): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::~LogMessage()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person::MergeFrom(test::Person const&)': 
person.pb.cc:(.text+0xf71): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' 
person.pb.cc:(.text+0xf87): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::operator<<(char const*)' 
person.pb.cc:(.text+0xfa2): Nicht definierter Verweis auf `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' 
person.pb.cc:(.text+0xfb6): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::~LogMessage()' 
person.pb.cc:(.text+0x10a8): Nicht definierter Verweis auf `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const*, google::protobuf::internal::ArenaStringPtr)' 
person.pb.cc:(.text+0x10f2): Nicht definierter Verweis auf `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const*, google::protobuf::internal::ArenaStringPtr)' 
person.pb.cc:(.text+0x1145): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::~LogMessage()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::Closure::Closure()': 
person.pb.cc:(.text._ZN6google8protobuf7ClosureC2Ev[_ZN6google8protobuf7ClosureC5Ev]+0x9): Nicht definierter Verweis auf `vtable for google::protobuf::Closure' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::FunctionClosure0::FunctionClosure0(void (*)(), bool)': 
person.pb.cc:(.text._ZN6google8protobuf8internal16FunctionClosure0C2EPFvvEb[_ZN6google8protobuf8internal16FunctionClosure0C5EPFvvEb]+0x22): Nicht definierter Verweis auf `vtable for google::protobuf::internal::FunctionClosure0' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::io::CodedOutputStream::IsDefaultSerializationDeterministic()': 
person.pb.cc:(.text._ZN6google8protobuf2io17CodedOutputStream35IsDefaultSerializationDeterministicEv[_ZN6google8protobuf2io17CodedOutputStream35IsDefaultSerializationDeterministicEv]+0x7): Nicht definierter Verweis auf `google::protobuf::io::CodedOutputStream::default_serialization_deterministic_' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::io::CodedInputStream::ReadVarint32(unsigned int*)': 
person.pb.cc:(.text._ZN6google8protobuf2io16CodedInputStream12ReadVarint32EPj[_ZN6google8protobuf2io16CodedInputStream12ReadVarint32EPj]+0x78): Nicht definierter Verweis auf `google::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::io::CodedOutputStream::VarintSize32(unsigned int)': 
person.pb.cc:(.text._ZN6google8protobuf2io17CodedOutputStream12VarintSize32Ej[_ZN6google8protobuf2io17CodedOutputStream12VarintSize32Ej]+0x1e): Nicht definierter Verweis auf `google::protobuf::io::CodedOutputStream::VarintSize32Fallback(unsigned int)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::ArenaStringPtr::CreateInstanceNoArena(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const*)': 
person.pb.cc:(.text._ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4b): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' 
person.pb.cc:(.text._ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x61): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::operator<<(char const*)' 
person.pb.cc:(.text._ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x79): Nicht definierter Verweis auf `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' 
person.pb.cc:(.text._ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8d): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::~LogMessage()' 
person.pb.cc:(.text._ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr21CreateInstanceNoArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xdc): Nicht definierter Verweis auf `google::protobuf::internal::LogMessage::~LogMessage()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::GoogleOnceInit(long*, void (*)())': 
person.pb.cc:(.text._ZN6google8protobuf14GoogleOnceInitEPlPFvvE[_ZN6google8protobuf14GoogleOnceInitEPlPFvvE]+0x5e): Nicht definierter Verweis auf `google::protobuf::GoogleOnceInitImpl(long*, google::protobuf::Closure*)' 
person.pb.cc:(.text._ZN6google8protobuf14GoogleOnceInitEPlPFvvE[_ZN6google8protobuf14GoogleOnceInitEPlPFvvE]+0x6a): Nicht definierter Verweis auf `google::protobuf::internal::FunctionClosure0::~FunctionClosure0()' 
person.pb.cc:(.text._ZN6google8protobuf14GoogleOnceInitEPlPFvvE[_ZN6google8protobuf14GoogleOnceInitEPlPFvvE]+0x7b): Nicht definierter Verweis auf `google::protobuf::internal::FunctionClosure0::~FunctionClosure0()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::UnknownFieldSet::Clear()': 
person.pb.cc:(.text._ZN6google8protobuf15UnknownFieldSet5ClearEv[_ZN6google8protobuf15UnknownFieldSet5ClearEv]+0x20): Nicht definierter Verweis auf `google::protobuf::UnknownFieldSet::ClearFallback()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::InternalMetadataWithArena::DoMergeFrom(google::protobuf::UnknownFieldSet const&)': 
person.pb.cc:(.text._ZN6google8protobuf8internal25InternalMetadataWithArena11DoMergeFromERKNS0_15UnknownFieldSetE[_ZN6google8protobuf8internal25InternalMetadataWithArena11DoMergeFromERKNS0_15UnknownFieldSetE]+0x70): Nicht definierter Verweis auf `google::protobuf::UnknownFieldSet::MergeFrom(google::protobuf::UnknownFieldSet const&)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::InternalMetadataWithArena::default_instance()': 
person.pb.cc:(.text._ZN6google8protobuf8internal25InternalMetadataWithArena16default_instanceEv[_ZN6google8protobuf8internal25InternalMetadataWithArena16default_instanceEv]+0x5): Nicht definierter Verweis auf `google::protobuf::UnknownFieldSet::default_instance()' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::MessageLite::MessageLite()': 
person.pb.cc:(.text._ZN6google8protobuf11MessageLiteC2Ev[_ZN6google8protobuf11MessageLiteC5Ev]+0x9): Nicht definierter Verweis auf `vtable for google::protobuf::MessageLite' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::MessageLite::~MessageLite()': 
person.pb.cc:(.text._ZN6google8protobuf11MessageLiteD2Ev[_ZN6google8protobuf11MessageLiteD5Ev]+0xd): Nicht definierter Verweis auf `vtable for google::protobuf::MessageLite' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::Message::Message()': 
person.pb.cc:(.text._ZN6google8protobuf7MessageC2Ev[_ZN6google8protobuf7MessageC5Ev]+0x19): Nicht definierter Verweis auf `vtable for google::protobuf::Message' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::Message::~Message()': 
person.pb.cc:(.text._ZN6google8protobuf7MessageD2Ev[_ZN6google8protobuf7MessageD5Ev]+0xd): Nicht definierter Verweis auf `vtable for google::protobuf::Message' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
>*)': 
person.pb.cc:(.text._ZN6google8protobuf8internal14WireFormatLite10ReadStringEPNS0_2io16CodedInputStreamEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14WireFormatLite10ReadStringEPNS0_2io16CodedInputStreamEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1f): Nicht definierter Verweis auf `google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
>*)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::WireFormatLite::WriteStringToArray(int, std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&, unsigned char*)': 
person.pb.cc:(.text._ZN6google8protobuf8internal14WireFormatLite18WriteStringToArrayEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh[_ZN6google8protobuf8internal14WireFormatLite18WriteStringToArrayEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh]+0x39): Nicht definierter Verweis auf `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__cxx11::basic_string<char, std::char_traits 
<char> 
, std::allocator 
<char> 
> const&, unsigned char*)' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `void google::protobuf::Arena::Own 
<test::Person> 
(test::Person*)': 
person.pb.cc:(.text._ZN6google8protobuf5Arena3OwnIN4test6PersonEEEvPT_[_ZN6google8protobuf5Arena3OwnIN4test6PersonEEEvPT_]+0x4d): Nicht definierter Verweis auf `google::protobuf::Arena::AddListNode(void*, void (*)(void*))' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `test::Person const* google::protobuf::internal::DynamicCastToGenerated 
<test::Person const> 
(google::protobuf::Message const*)': 
person.pb.cc:(.text._ZN6google8protobuf8internal22DynamicCastToGeneratedIKN4test6PersonEEEPT_PKNS0_7MessageE[_ZN6google8protobuf8internal22DynamicCastToGeneratedIKN4test6PersonEEEPT_PKNS0_7MessageE]+0x37): Nicht definierter Verweis auf `typeinfo for google::protobuf::Message' 
CMakeFiles/client.dir/person.pb.cc.o: In Funktion `google::protobuf::internal::InternalMetadataWithArenaBase<google::protobuf::UnknownFieldSet, google::protobuf::internal::InternalMetadataWithArena>::mutable_unknown_fields_slow()': 
person.pb.cc:(.text._ZN6google8protobuf8internal29InternalMetadataWithArenaBaseINS0_15UnknownFieldSetENS1_25InternalMetadataWithArenaEE27mutable_unknown_fields_slowEv[_ZN6google8protobuf8internal29InternalMetadataWithArenaBaseINS0_15UnknownFieldSetENS1_25InternalMetadataWithArenaEE27mutable_unknown_fields_slowEv]+0xbd): Nicht definierter Verweis auf `google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned long)' 
person.pb.cc:(.text._ZN6google8protobuf8internal29InternalMetadataWithArenaBaseINS0_15UnknownFieldSetENS1_25InternalMetadataWithArenaEE27mutable_unknown_fields_slowEv[_ZN6google8protobuf8internal29InternalMetadataWithArenaBaseINS0_15UnknownFieldSetENS1_25InternalMetadataWithArenaEE27mutable_unknown_fields_slowEv]+0x118): Nicht definierter Verweis auf `google::protobuf::Arena::AddListNode(void*, void (*)(void*))' 
CMakeFiles/client.dir/person.pb.cc.o:(.rodata._ZTVN4test6PersonE[_ZTVN4test6PersonE]+0x20): Nicht definierter Verweis auf `google::protobuf::Message::GetTypeName[abi:cxx11]() const' 
CMakeFiles/client.dir/person.pb.cc.o:(.rodata._ZTVN4test6PersonE[_ZTVN4test6PersonE]+0x58): Nicht definierter Verweis auf `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const' 
CMakeFiles/client.dir/person.pb.cc.o:(.rodata._ZTVN4test6PersonE[_ZTVN4test6PersonE]+0x60): Nicht definierter Verweis auf `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)' 
CMakeFiles/client.dir/person.pb.cc.o:(.rodata._ZTVN4test6PersonE[_ZTVN4test6PersonE]+0xa8): Nicht definierter Verweis auf `google::protobuf::Message::DiscardUnknownFields()' 
CMakeFiles/client.dir/person.pb.cc.o:(.rodata._ZTVN4test6PersonE[_ZTVN4test6PersonE]+0xb0): Nicht definierter Verweis auf `google::protobuf::Message::SpaceUsed() const' 
CMakeFiles/client.dir/person.pb.cc.o:(.rodata._ZTIN4test6PersonE[_ZTIN4test6PersonE]+0x10): Nicht definierter Verweis auf `typeinfo for google::protobuf::Message' 
collect2: error: ld returned 1 exit status 
CMakeFiles/client.dir/build.make:129: die Regel für Ziel „client“ scheiterte 
make[2]: *** [client] Fehler 1 
CMakeFiles/Makefile2:67: die Regel für Ziel „CMakeFiles/client.dir/all“ scheiterte 
make[1]: *** [CMakeFiles/client.dir/all] Fehler 2 
Makefile:83: die Regel für Ziel „all“ scheiterte 
make: *** [all] Fehler 2 
> 

Я уже пытался полностью заново построить приложение (удалено накопление папку), а также переустанавливать GoogleProtocolBuffers в разные версии. Это мой CMakeLists.txt-File ->

cmake_minimum_required(VERSION 3.0) 

project(18_HTTPClient) # change xxx to your project name 

set(CMAKE_CXX_STANDARD 14) # change if necessary 

add_definitions(-DASIO_STANDALONE) 

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR 
    "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 
    #add_definitions(-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion) 
    # add_definitions(-Wl,--no-as-needed) # needed for building on buggy configurations 
else() 
    add_definitions(-DASIO_HAS_STD_ADDRESSOF) 
    add_definitions(-DASIO_HAS_STD_ARRAY) 
    add_definitions(-DASIO_HAS_CSTDINT) 
    add_definitions(-DASIO_HAS_STD_SHARED_PTR) 
    add_definitions(-DASIO_HAS_STD_TYPE_TRAITS) 
    add_definitions(-DASIO_HAS_STD_ATOMIC) 
    add_definitions(-D_WIN32_WINNT=0x0501) 
    add_definitions(/Wall /EHsc) 
endif() 

find_package(Threads) 

include_directories(include) 
include_directories(include/STLPlus) 

# important: Don't forget to set the environment variable accordingly (if needed)! 
include_directories($ENV{ASIO_INCLUDE_PATH}) 
include_directories($ENV{SPDLOG_INCLUDE_PATH}) 
include_directories($ENV{FMT_PATH}) # should refer to the root directory of fmt 
include_directories($ENV{JSON_INCLUDE_PATH}) # should refer to the directory 'src' of json 

set(FMT_LIB_PATH $ENV{FMT_PATH}/fmt/fmt/libfmt.a) 
#set(FMT_LIB_PATH $ENV{FMT_PATH}/build/fmt/libfmt.a) 

# only needed for protobuf 
find_package(Protobuf REQUIRED) 
include_directories(${Protobuf_INCLUDE_DIRS}) 
include_directories(${CMAKE_CURRENT_BINARY_DIR}) 
file(GLOB protos protos/*.proto) 
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${protos}) 

macro(create_targets) 
    if(${ARGC} GREATER 1) 
    foreach(curr_target ${ARGV}) 
     message(${curr_target}) 
     # includes are only for usage with QtCreator! 
     file(GLOB sources src/${curr_target}/*.cpp src/*.cpp include/${curr_target}/*.h include/*.h) 
     add_executable(${curr_target} ${sources} ${PROTO_SRCS} ${PROTO_HDRS}) 
     target_link_libraries(${curr_target} ${CMAKE_THREAD_LIBS_INIT} ${FMT_LIB_PATH} ${Protobuf_LIBRARIES}) 
    endforeach(curr_target) 
    else() 
    message(${ARGV0}) 
    IF(EXISTS "${CMAKE_SOURCE_DIR}/src/${ARGV0}" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${ARGV0}") 
     file(GLOB sources src/${ARGV0}/*.cpp src/*.cpp include/${ARGV0}/*.h include/*.h) 
    else() 
     file(GLOB sources src/*.cpp include/*.h) 
    endif() 
    message(${sources}) 
    add_executable(${ARGV0} ${sources} ${PROTO_SRCS} ${PROTO_HDRS}) 
    target_link_libraries(${ARGV0} ${CMAKE_THREAD_LIBS_INIT} ${FMT_LIB_PATH} ${Protobuf_LIBRARIES}) 
    endif() 
endmacro(create_targets) 

# replace xxx with list of executables 
# like: create_targets(exe) or create_targets(exe1 exe2 exe3) 
# if just one target is given -> source files are in 'src' 
# else -> source files specific for each target are in respective 
# subdirectories of 'src' like in 'src/exe1', 'src/exe2', and 'src/exe3' 
# common source files are in 'src' 
create_targets(client) 

Любые предложения о том, что я могу сделать по этому поводу? Заранее спасибо. Если вам нужны какие-либо подробности или содержимое файла, я загружу их как можно быстрее.

+0

@ πάνταῥεῖ Спасибо за помощь - отредактировал этот вопрос и добавил CMakeLists.txt – Blackbird

+0

Возможно, вам не хватает ссылки на нужную библиотеку. Уменьшите ваш пример дальше, он должен долго пробираться. – usr1234567

+1

Я бы предположил, что вы можете столкнуться с какой-то проблемой совместимости с ABI от микширования C++ 11 и C++ 14. –

ответ

0

Я подозреваю, что вы используете версию cmake раньше 3.6. Если это так, то может решить вашу проблему либо обновление, либо использование PROTOBUF_ вместо Protobuf_; см. также this SO answer для деталей.