文档首页 > > 移植指南> RPC框架> 移植gRPC> 故障排除

故障排除

分享
更新时间:2020/03/19 GMT+08:00

问题一:编译过程中提示找不到依赖包

问题描述

移植指导中编译Demo,执行make命令后,提示找不到相关依赖包的错误,如下:

Package protobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing `protobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'protobuf' found
Package grpc++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `grpc++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'grpc++' found
Package grpc was not found in the pkg-config search path.
Perhaps you should add the directory containing `grpc.pc'
to the PKG_CONFIG_PATH environment variable
No package 'grpc' found
/usr/bin/ld: greeter_client.o: undefined reference to symbol '_ZN9grpc_impl26InsecureChannelCredentialsEv'
//usr/local/lib/libgrpc++.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [greeter_client] Error 1

问题原因:缺少“PKG_CONFIG_PATH”环境变量配置

解决方法

请参见移植指导设置“PKG_CONFIG_PATH”环境变量,确保环境变量生效后,先执行make clean清除上次未编译成功的Demo之后,再重新参见移植指导验证Demo是否编译成功,且运行正常。

问题二:编译过程中提示无法加载“libgrpc++.so.”1的错误

问题描述

移植指导 编译Demo,make编译成功后,执行服务器端程序 ./greeter_server时,提示无法加载“libgrpc++.so.1”的错误,如下:

./greeter_server: error while loading shared libraries: libgrpc++.so.1: cannot open shared object file: No such file or direc
tory

问题原因:缺少“LD_LIBRARY_PATH”环境变量配置

解决方法:请参见移植指导设置“LD_LIBRARY_PATH”环境变量,确保环境变量生效后,先执行make clean清除上次未编译成功的Demo之后,再重新参见移植指导验证Demo是否编译成功,且运行正常。

分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!非常感谢您的反馈,我们会继续努力做到更好!
反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

智能客服提问云社区提问