title: How to port grpc helloworld(CPP) example on yocto
body: <p>Hey i am trying to port the helloworld, cpp based demo for <a href="https://github.com/grpc/grpc/tree/master/examples/cpp/helloworld" rel="nofollow noreferrer">gRPC</a> on yocto pyro on Ubuntu 16.04 LTS for target arm, . But i am getting the error.</p>
  
  <p><strong>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</strong> </p>
  
  <p><strong>/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</strong></p>
  
  <p><strong>--grpc_out: protoc-gen-grpc: Plugin failed with status code 127.</strong></p>
  
  <p><strong>Makefile:55: recipe for target 'hello.grpc.pb.cc' faile</strong></p>
  
  <p>So can anyone suggest the steps to solve this error.</p>
  
  <p>Please find the  helloworld.bb file.</p>
  
  <pre><code>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} = "/*"  
  </code></pre>
  
  <p>Please find the makefile for it.</p>
  
  <pre><code>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) $&lt;
  
  .PRECIOUS: %.pb.cc
  %.pb.cc: %.proto
      $(PROTOC) -I $(PROTOS_PATH) --cpp_out=. $&lt;
  
  clean:
      rm -f *.o *.pb.cc *.pb.h hello_client hello_server
  </code></pre>
  
  <p>Please find the my <a href="http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/grpc/grpc_1.8.5.bb?h=master" rel="nofollow noreferrer">grpc_1.8.5.bb</a> file.                                                                                                                                                   </p>