Problem with cpp hello world example

247 views
Skip to first unread message

Rajarshi Biswas

unread,
May 8, 2017, 6:48:35 PM5/8/17
to grpc.io
Hello guys, 

I am having the following issue while running the greeter_server example. 

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

But 

ll ../../../install/lib/libgrpc++*
-rwxr-xr-x 1 biswas.91 biswas.91 1939536 May  8 18:02 ../../../install/lib/libgrpc++.a
-rwxr-xr-x 1 biswas.91 biswas.91 4868510 May  8 18:02 ../../../install/lib/libgrpc++_cronet.a
lrwxrwxrwx 1 biswas.91 biswas.91      25 May  8 18:02 ../../../install/lib/libgrpc++_cronet.so -> libgrpc++_cronet.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91  956448 May  8 18:02 ../../../install/lib/libgrpc++_cronet.so.1.3.0
lrwxrwxrwx 1 biswas.91 biswas.91      25 May  8 18:02 ../../../install/lib/libgrpc++_cronet.so.3 -> libgrpc++_cronet.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91  162902 May  8 18:02 ../../../install/lib/libgrpc++_error_details.a
lrwxrwxrwx 1 biswas.91 biswas.91      32 May  8 18:02 ../../../install/lib/libgrpc++_error_details.so -> libgrpc++_error_details.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91 1423240 May  8 18:02 ../../../install/lib/libgrpc++_error_details.so.1.3.0
lrwxrwxrwx 1 biswas.91 biswas.91      32 May  8 18:02 ../../../install/lib/libgrpc++_error_details.so.3 -> libgrpc++_error_details.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91  587184 May  8 18:02 ../../../install/lib/libgrpc++_reflection.a
lrwxrwxrwx 1 biswas.91 biswas.91      29 May  8 18:02 ../../../install/lib/libgrpc++_reflection.so -> libgrpc++_reflection.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91 1649440 May  8 18:02 ../../../install/lib/libgrpc++_reflection.so.1.3.0
lrwxrwxrwx 1 biswas.91 biswas.91      29 May  8 18:02 ../../../install/lib/libgrpc++_reflection.so.3 -> libgrpc++_reflection.so.1.3.0
lrwxrwxrwx 1 biswas.91 biswas.91      18 May  8 18:02 ../../../install/lib/libgrpc++.so -> libgrpc++.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91  761976 May  8 18:02 ../../../install/lib/libgrpc++.so.1.3.0
lrwxrwxrwx 1 biswas.91 biswas.91      18 May  8 18:02 ../../../install/lib/libgrpc++.so.3 -> libgrpc++.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91 1795644 May  8 18:02 ../../../install/lib/libgrpc++_unsecure.a
lrwxrwxrwx 1 biswas.91 biswas.91      27 May  8 18:02 ../../../install/lib/libgrpc++_unsecure.so -> libgrpc++_unsecure.so.1.3.0
-rwxr-xr-x 1 biswas.91 biswas.91  716504 May  8 18:02 ../../../install/lib/libgrpc++_unsecure.so.1.3.0
lrwxrwxrwx 1 biswas.91 biswas.91      27 May  8 18:02 ../../../install/lib/libgrpc++_unsecure.so.3 -> libgrpc++_unsecure.so.1.3.0

So when I make gRPC , it did not generate libgrpc++.so.1, but greeter_server is looking for that. What am i doing wrong here?

Thanks. 

_Rajarshi 


Rajarshi Biswas

unread,
May 10, 2017, 12:32:14 PM5/10/17
to grpc.io
OK never mind.
I have fixed it by doing a static link to libgrpc++.a

GM

unread,
May 11, 2017, 3:06:28 AM5/11/17
to grpc.io
Hi I am having the same problem, can you elaborate on how to solve it.

Rajarshi Biswas

unread,
May 11, 2017, 11:41:43 AM5/11/17
to GM, grpc.io
Hi,

I used the following flags in the Makefile for hellpworld.

46   SLIBS += /home/biswas.91/grpc/install/lib/libgrpc++.a
47  LDFLAGS += -L/usr/local/lib  -L//home/biswas.91/grpc/third_party/protobuf/src/.libs/ -L/home/biswas.91/grpc/install/lib/ \
48            -lprotobuf -lpthread -lgrpc


And this is how I link
 61 greeter_client: helloworld.pb.o helloworld.grpc.pb.o greeter_client.o
 62         $(CXX) $^ $(LDFLAGS) -o $@ $(SLIBS)
 63
 64 greeter_server: helloworld.pb.o helloworld.grpc.pb.o greeter_server.o
 65         $(CXX) $^ $(LDFLAGS) -o $@ $(SLIBS)

Hope these help. 

Rajarshi 

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/zFhTb27BGa0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/0fbc72dc-b98e-4a2d-a850-c87a2deda898%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Rajarshi Biswas
Citrix R&D
India

Reply all
Reply to author
Forward
0 new messages