assistant-sdk-cpp icon indicating copy to clipboard operation
assistant-sdk-cpp copied to clipboard

Build error and Fix

Open rochefort8 opened this issue 7 years ago • 2 comments

Final stage of build process, "make run_assisitant" may give me the following error,

 g++ /home/ubuntu/git/assistant-sdk-cpp//googleapis/gens/google/assistant/embedded/v1alpha2/embedded_assistant.pb.o /home/ubuntu/git/assistant-sdk-cpp//googleapis/gens/google/assistant/embedded/v1alpha2/embedded_assistant.grpc.pb.o googleapis.ar src/json_util.o src/base64_encode.o src/run_assistant_text.o  -lm -lm  -lgrpc_cronet -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -lprotobuf -lpthread -ldl -lcurl  -o run_assistant_text
/usr/bin/ld: /home/ubuntu/git/assistant-sdk-cpp//googleapis/gens/google/assistant/embedded/v1alpha2/embedded_assistant.grpc.pb.o: undefined reference to symbol '_ZN4grpc6g_glipE'
//usr/local/lib/libgrpc++.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:104: recipe for target 'run_assistant_text' failed
make: *** [run_assistant_text] Error 1

(Means "Undefined symble grpc::g_glip according to my small investigation)

I found this may be fixed with the following change,

iff --git a/Makefile b/Makefile
index b3e4cb3..72e9177 100644
--- a/Makefile
+++ b/Makefile
@@ -64,8 +64,8 @@ LDFLAGS += $(GRPC_GRPCPP_LDLAGS) \
            -lprotobuf -lpthread -ldl -lcurl
 else
 LDFLAGS += $(GRPC_GRPCPP_LDLAGS) \
-           -lgrpc_cronet -Wl,--no-as-needed -lgrpc++_reflection \
-           -Wl,--as-needed -lprotobuf -lpthread -ldl -lcurl
+           -lgrpc_cronet -Wl,--no-as-needed -lgrpc++_reflection -lgrpc++ \
+           -Wl,--as-needed -lprotobuf -lpthread -ldl -lcurl -lasound
 endif

Seemed that linking of the alsa sound and grpc libraries were missing, but I have no idea whether this change is the correct way to fix this issues, hope to provide me the proper way,

Thanks and BRs,

rochefort8 avatar Jul 23 '18 04:07 rochefort8

I found this seemed to cause by the same issue mentioned in #35, Removing "google/ads" tentatively lead to fix every error I wrote in this issue and worked fine on Ubuntu Linux on AES EC2.

rochefort8 avatar Jul 25 '18 09:07 rochefort8

Okay, then fixing the build instructions should fix both.

Fleker avatar Jul 25 '18 18:07 Fleker