简体   繁体   English

如何在yocto上移植grpc helloworld(CPP)示例

[英]How to port grpc helloworld(CPP) example on yocto

Hey i am trying to port the helloworld, cpp based demo for gRPC on yocto pyro on Ubuntu 16.04 LTS for target arm, . 嘿,我正在尝试在Ubuntu 16.04 LTS上的yocto pyro上为gcp的helloworld基于cpp的演示移植目标臂。 But i am getting the error. 但是我得到了错误。

protoc -I ./ --grpc_out=. protoc -I ./ --grpc_out =。 --plugin=protoc-gen-grpc=/home/admin/BUILD/tmp/sysroots-components/x86_64/grpc-native/usr/bin/grpc_cpp_plugin hello.proto --plugin = protoc-gen-grpc = / home / admin / BUILD / tmp / sysroots-components / x86_64 / grpc-native / usr / bin / grpc_cpp_plugin hello.proto

/home/admin/BUILD/tmp/sysroots-components/x86_64/grpc-native /usr/bin/grpc_cpp_plugin: error while loading shared libraries:libprotoc.so.15: cannot open shared object file: No such file or directory / home / admin / BUILD / tmp / sysroots-components / x86_64 / grpc-native / usr / bin / grpc_cpp_plugin:加载共享库时出错:libprotoc.so.15:无法打开共享库文件:没有这样的文件或目录

--grpc_out: protoc-gen-grpc: Plugin failed with status code 127. --grpc_out:protoc-gen-grpc:插件失败,状态码为127。

Makefile:55: recipe for target 'hello.grpc.pb.cc' faile Makefile:55:目标“ hello.grpc.pb.cc”的配方失败

So can anyone suggest the steps to solve this error. 因此,任何人都可以建议解决此错误的步骤。

Please find the helloworld.bb file. 请找到helloworld.bb文件。

DESCRIPTION = "Hello world"  
SECTION = "Hello world"  
LICENSE = "CLOSED"  

S = "${COREBASE}/../../../src_dir/hello"  
B = "${S}"  

inherit externalsrc  
EXTERNALSRC_pn-hello = "${S}"  
EXTERNALSRC_BUILD_pn-hello = "${B}"  
EXTERNALSRC_SYMLINKS_pn-hello = ""  

DEPENDS = "grpc-native protobuf-native protobuf-c gflags c-ares protobuf-c-native openssl"  

PR = "r1"  

PARALLEL_MAKE =""  

TARGET_CXX_ARCH += "${LDFLAGS}"  


do_compile() {  
 oe_runmake  
}  


ALLOW_EMPTY_${PN} = "1"  
FILES_${PN} = "/*"  

Please find the makefile for it. 请找到它的makefile。

CXX = arm-poky-linux-gnueabi-g++  -march=armv7-a -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a8 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/home/admin/BUILD/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/hello-demo/0.1.0-r1/recipe-sysroot


CXXFLAGS += -std=c++11
ifeq ($(SYSTEM),Darwin)
LDFLAGS += -L/usr/local/lib  `pkg-config --libs protobuf grpc++ grpc`\
       -ldl
else
LDFLAGS +=  -L/home/admin/BUILD/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/hello-demo/0.1.0-r1/recipe-sysroot/usr/lib -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\
       -ldl

endif
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= /home/admin/BUILD/tmp/sysroots-components/x86_64/grpc-native/usr/bin/grpc_cpp_plugin

PROTOS_PATH = ./

vpath %.proto $(PROTOS_PATH)

all: hello_client hello_server

hello_client: hello.pb.o hello.grpc.pb.o hello-client.o
    $(CXX) $^ $(LDFLAGS) -o $@


hello_server: hello.pb.o hello.grpc.pb.o hello-server.o
    $(CXX) $^ $(LDFLAGS) -o $@


.PRECIOUS: %.grpc.pb.cc
%.grpc.pb.cc: %.proto
    $(PROTOC) -I $(PROTOS_PATH) --grpc_out=. --plugin=protoc-gen-  grpc=$(GRPC_CPP_PLUGIN_PATH) $<

.PRECIOUS: %.pb.cc
%.pb.cc: %.proto
    $(PROTOC) -I $(PROTOS_PATH) --cpp_out=. $<

clean:
    rm -f *.o *.pb.cc *.pb.h hello_client hello_server

Please find the my grpc_1.8.5.bb file. 请找到我的grpc_1.8.5.bb文件。

I think it has nothing to do with the gRPC example, looks like there is an issue with protoc installation script on Linux - it doesn't update dynamic libraries bindings. 我认为这与gRPC示例无关,看起来Linux上的协议安装脚本存在问题-它不会更新动态库绑定。 Try to run "ldconfig" from root. 尝试从根目录运行“ ldconfig”。 And run "protoc" after it, without any arguments. 然后在没有任何参数的情况下运行“ protoc”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法编译 grpc c++ helloworld 示例 - Cannot compile grpc c++ helloworld example 如何为gRPC ++编写yocto食谱? - How to write a yocto recipe for gRPC++? 构建依赖于 grpc 的 Yocto bitbake 配方,grpc-native 失败说 grpc_cpp_plugin 不存在 - Building a Yocto bitbake recipe, which depends on grpc, grpc-native fails saying the the grpc_cpp_plugin does not exist gRPC - C++ 异步 HelloWorld 客户端示例不异步执行任何操作 - gRPC - C++ Async HelloWorld Client Example doesn't do anything asynchronously 如何使用Necessitas(qt端口)构建我的HelloWorld Android应用程序? - How to build my HelloWorld Android application with Necessitas (qt port)? gRPC (cpp) - 如何检查 RPC 通道是否连接成功? - gRPC (cpp) - How can I check if the RPC channel connected successfully? 如何在cocos2d-x中创建一个可以包含在HelloWorld.cpp中的Layer文件? - how to make a Layer file that can be included in HelloWorld.cpp in cocos2d-x …? "如何在安装了 WSL 的 Visual Studio Code 中修复“g++:错误:helloworld.cpp:没有这样的文件或目录”?" - How to fix "g++: error: helloworld.cpp: No such file or directory" in visual Studio Code with WSL installed? HelloWorld.cpp无法编译 - HelloWorld.cpp can't Compile 在GRPC中使用字节数组(cpp) - Using byte array (cpp) in GRPC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM