这似乎是protobuf链接错误。我正在描述我到达这里要遵循的步骤。
注意:以下链接用于安装 Protocol Buffer 编译器和gRPC。如果您已经有一个正在运行的gRPC系统,则可以跳过它
1. https://github.com/grpc/grpc/blob/master/BUILDING.md
2. https://github.com/grpc/grpc/tree/master/src/cpp
3. https://github.com/protocolbuffers/protobuf
注意:以下链接是获取并运行Google为语音识别应用程序提供的示例代码。
在步骤9-
make run_tests
上,我收到此错误g++ transcribe.o parse_arguments.o googleapis.ar -L/usr/local/lib `pkg-config --libs grpc++ grpc` -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -lprotobuf -lpthread -ldl -o transcribe
/usr/local/lib/libgrpc++_reflection.so: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::AssignDescriptorsTable*)'
/usr/local/lib/libgrpc++_reflection.so: undefined reference to `google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable*, void (* const*)(), int)'
collect2: error: ld returned 1 exit status
AssignDescriptors
和AddDescriptors
是否正确声明和定义。 在哪里可以找到这些声明的函数? 任何积极的帮助将不胜感激。谢谢
最佳答案
我观察到grpc++版本1.19不支持protobuf-c版本15。
为了使此工作有效,我将symlink指针从libprotobuf-c.so.15
更改为libprotobuf-c.so.17
。
关于c++ - Google语音识别(cpp示例):对AssignDescriptors()的 undefined reference ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54341578/