Unable to build standalone app based on google cloud speech code using Makefile #9817
-
We are trying to build a standalone sample application and calling speech Recognize methods as mentioned in quickstart app. I have already built google-cloud-cpp repo and its required dependencies for Ubuntu 18.04 on my system as explained in packaging link. I have installed all the produced libraries in /usr/local/lib/ Post building I utilised these libraries in my Makefile to build cpp code but it fails with "undefined references" errors. To resolve the errors, I have included all the libraries inside my vcpkg : VCLIBS = $(wildcard /root/vcpkg/packages//lib/.a) I included all libraries downloaded/installed by vcpkg and referred them in my Makefile which executes by code successfully. I am also able to get results from Recognize and AsyncStreamingRecognize methods from my cpp sample code. I sharing my Makefile which includes all the dependencies I have tried to build the code. I have commented out the references I have used after building google-cloud-cpp. sample-github.txt Although I followed the steps as per the website, but doubt that I am doing this correctly. I might have missed some steps or have installed wrong versions of dependencies but I am not sure about this. Ideally I should have only used libraries and header files from /usr/local/ folder. Can someone please look into my Makefile and suggest the corrections or guide me to the right path ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hmmm.
I am confused. Why are you trying to use the packaging instructions and use vcpkg? If you use vcpkg you don't need to install
It sounds like you are asking how to simplify all of this, as the approach you followed "works", but it is obviously very complicated and fraught with problems. If I misunderstand your request please let me know. The first thing I would do is pick one approach for dependency management and get that approach to work. Since you are willing to use
You can do the opposite if that works better for you. I will avoid making further recommendations until I understand what is your next step.
I cannot give you detailed instructions until I understand which approach (vcpkg vs. installing in /usr/local) you are trying to use. Meanwhile I can provide some suggestions: Your VCLIBS = $(wildcard /root/vcpkg/packages/*/lib/*.a) If I was writing a Your LIBS = -L/root/vcpkg/packages/google-cloud-cpp_x64-linux/lib \
-lgoogle_cloud_cpp_api_context_protos -lgoogle_cloud_cpp_api_quota_protos -lgoogle_cloud_cpp_speech -lgoogle_cloud_cpp_type_phone_number_protos \
-lgoogle_cloud_cpp_speech_protos -lgoogle_cloud_cpp_type_postal_address_protos \
-lgoogle_cloud_cpp_grpc_utils \```
...
... If I was writing a Makefile I would not curate the list of libraries manually. The google-cloud-cpp/google/cloud/speech/quickstart/Makefile Lines 29 to 32 in a7d1919 That should work regardless of whether you use |
Beta Was this translation helpful? Give feedback.
Hmmm.
I am confused. Why are you trying to use the packaging instructions and use vcpkg? If you use vcpkg you don't need to install
google-cloud-cpp
in/usr/local/
, vcpkg will install it for you in its preferred install loc…