2017-05-15 1 views
0
OS -> OSX El Captain Version 10.11.6 

versucht zu installieren gRPC die folgenden Befehle:Installation gRPC: ld: Warnung: Verzeichnis nicht für Option gefunden '-L/<path>/grpc/libs/opt/c-ares'

  1. git clone-b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc
  2. cd grpc
  3. git submodule update --init
  4. make

habe ich den folgenden Fehler:

[HOSTCXX] Compiling src/compiler/cpp_plugin.cc 
    [HOSTLD] Linking /<path>/grpc/bins/opt/grpc_cpp_plugin 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    Undefined symbols for architecture x86_64: 
    "google::protobuf::io::StringOutputStream::StringOutputStream(std::__1::basic_string<char, std::__1::char_traits<char>, 
    std::__1::allocator<char> >*)", referenced from: 
    ProtoBufFile::CreatePrinter(std::__1::basic_string<char, 
    std::__1::char_traits<char>, std::__1::allocator<char> >*) const in cpp_plugin.o 

    "google::protobuf::io::Printer::Print(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, char const*)", referenced from: 
    ProtoBufPrinter::Print(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, char const*) in cpp_plugin.o 

    "google::protobuf::FileDescriptor::GetSourceLocation(std::__1::vector<int, std::__1::allocator<int> > const&, google::protobuf::SourceLocation*) const", referenced from: 
    void grpc_generator::GetComment<google::protobuf::FileDescriptor>(google::protobuf::FileDescriptor const*, grpc_generator::CommentType, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in cpp_plugin.o 
    "google::protobuf::compiler::CodeGenerator::GenerateAll(std::__1::vector<google::protobuf::FileDescriptor const*, std::__1::allocator<google::protobuf::FileDescriptor const*> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::compiler::GeneratorContext*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) const", referenced from: 
    vtable for CppGrpcGenerator in cpp_plugin.o 
    ld: symbol(s) not found for architecture x86_64 
    clang: error: linker command failed with exit code 1 (use -v to see invocation) 
    make: *** [/<path>/grpc/bins/opt/grpc_cpp_plugin] Error 1 

Dies ist es, was ich in

/<path>/grpc/libs/opt/ directory : 
- libares.a  
- libgpr.a 
- libgrpc_cronet.a  
- libgrpc_unsecure.a 
- libboringssl.a 
- libgrpc.a    
- libgrpc_plugin_support.a 
- pkgconfig 

[EDIT]

Nach protobuf zu deinstallieren und wieder zum Laufen mache ich die folgenden Warnungen erhalten:

[LD]  Linking /<path>/grpc/libs/opt/libgpr.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc_cronet.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc_unsecure.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc++.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc++_cronet.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc++_error_details.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc++_reflection.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 
    [LD]  Linking /<path>/grpc/libs/opt/libgrpc++_unsecure.dylib 
    ld: warning: directory not found for option '-L/<path>/grpc/libs/opt/c-ares' 

Wenn ich mit dem insta fortfahre llation durch Ausführen von 'sudo make install', protobuf wird nicht installiert und grpc_cpp_plugin funktioniert nicht (gibt den folgenden Fehler aus).

grpc_cpp_plugin: program not found or is not executable 
    --grpc_out: protoc-gen-grpc: Plugin failed with status code 1. 

[EDIT]

Für die c-ares Problem, ich installierte es Homebrew brew install c-ares verwenden. Dann installiert Grpc grpc-1.3.0.tar.gz und Protobuf libprotoc 3.2.0 ohne Fehler. Aber wenn ich make im Hello World Beispiel laufen, ich erhalte den folgenden Fehler:

protoc -I ../../protos --cpp_out=. ../../protos/helloworld.proto 
g++ -std=c++11 -I/usr/local/include -pthread -c -o helloworld.pb.o helloworld.pb.cc 
protoc -I ../../protos --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ../../protos/helloworld.proto 
g++ -std=c++11 -I/usr/local/include -pthread -c -o helloworld.grpc.pb.o helloworld.grpc.pb.cc 
g++ -std=c++11 -I/usr/local/include -pthread -c -o greeter_client.o greeter_client.cc 
g++ helloworld.pb.o helloworld.grpc.pb.o greeter_client.o -L/usr/local/lib `pkg-config --libs grpc++ grpc` -lgrpc++_reflection -lprotobuf -lpthread -ldl -o greeter_client 
Undefined symbols for architecture x86_64: 
    "grpc::CreateChannel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc::ChannelCredentials> const&)", referenced from: 
     _main in greeter_client.o 
    "google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))", referenced from: 
     helloworld::protobuf_helloworld_2eproto::AddDescriptorsImpl()  in helloworld.pb.o 
    "google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)", referenced from: 
     google::protobuf::internal::WireFormatLite::WriteStringToArray(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*) in helloworld.pb.o 
    "google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, google::protobuf::internal::ArenaStringPtr)", referenced from: 
     helloworld::HelloRequest::HelloRequest(helloworld::HelloRequest const&) in helloworld.pb.o 
     helloworld::HelloRequest::HelloRequest(helloworld::HelloRequest const&) in helloworld.pb.o 
     helloworld::HelloRequest::MergeFrom(helloworld::HelloRequest const&) in helloworld.pb.o 
     helloworld::HelloReply::HelloReply(helloworld::HelloReply const&) in helloworld.pb.o 
     helloworld::HelloReply::HelloReply(helloworld::HelloReply const&) in helloworld.pb.o 
     helloworld::HelloReply::MergeFrom(helloworld::HelloReply const&) in helloworld.pb.o 
    "google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::io::CodedOutputStream*)", referenced from: 
     helloworld::HelloRequest::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in helloworld.pb.o 
     helloworld::HelloReply::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const in helloworld.pb.o 
    "google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)", referenced from: 
     google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) in helloworld.pb.o 
    "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**)", referenced from: 
     helloworld::protobuf_helloworld_2eproto::(anonymous namespace)::protobuf_AssignDescriptors() in helloworld.pb.o 
    "google::protobuf::internal::fixed_address_empty_string[abi:cxx11]", referenced from: 
     google::protobuf::internal::GetEmptyStringAlreadyInited[abi:cxx11]() in helloworld.pb.o 
     google::protobuf::internal::GetEmptyStringAlreadyInited[abi:cxx11]() in greeter_client.o 
    "google::protobuf::Message::GetTypeName[abi:cxx11]() const", referenced from: 
     vtable for helloworld::HelloReply in helloworld.pb.o 
     vtable for helloworld::HelloRequest in helloworld.pb.o 
    "google::protobuf::Message::InitializationErrorString[abi:cxx11]() const", referenced from: 
     vtable for helloworld::HelloReply in helloworld.pb.o 
     vtable for helloworld::HelloRequest in helloworld.pb.o 
ld: symbol(s) not found for architecture x86_64 
collect2: error: ld returned 1 exit status 
make: *** [greeter_client] Error 1 

Dank

Antwort

0

Es könnte mit falschen oder beschädigten Version installiert protobuf in Beziehung gesetzt werden, denn wenn protobuf installiert ist und version mehr als 3.0, als gRPC building system verwendet system's protobuf, instread thrird-party-protobuf von subrepo. Versuchen Sie, protobuf in Ihrem System zu entfernen oder zu reparieren.

UPDATE: Für neue Ausgaben versuchen Sie, "readelf -s lib ???. So" für jede grpc und protobuf Bibliothek auszuführen, und versuchen Sie, diese Symbole in Bibliotheken zu finden. Wenn in einer Bibliothek "UND" angegeben ist, ist es eine falsche Bibliothek. Zweite Dinge, die Sie tun sollten, führen Sie "Datei lib ???. So" für jede Grpc und Protobuf-Bibliothek für Check-Binär-Typ: x86_64 oder nicht.

+0

Kannst du bitte mit den Fehlern helfen, nachdem ich den Beitrag bearbeitet habe .. Danke .. – Akshay

Verwandte Themen