kunpengmdw
故障排除
更新时间: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是否编译成功,且运行正常。
父主题: 移植gRPC
