Unable to build protoc-gen-grpc-web on macOS
See original GitHub issueI have been following the grpc-web helloworld example but am stuck when trying to build the protoc-gen-grpc-web
plugin on my Mac. Here’s what happens:
nmurthy:grpc-web% sudo make install-plugin
cd "/Users/nmurthy/Workspace/grpc-web"/javascript/net/grpc/web && make install
g++ grpc_generator.o -L/usr/local/lib -lprotoc -lprotobuf -lpthread -ldl -o protoc-gen-grpc-web
ld: library not found for -lprotoc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [protoc-gen-grpc-web] Error 1
make: *** [install-plugin] Error 2
Wondering how do I properly link this library?
(Cross posted here: https://groups.google.com/forum/#!topic/grpc-io/kcIZb6N_Lhg)
Here’s my setup:
nmurthy:grpc-web% protoc --version
libprotoc 3.6.1
nmurthy:grpc-web% which protoc
/Users/nmurthy/Tools/protoc-3.6.1-osx-x86_64/bin/protoc
nmurthy:grpc-web% ls -l ~/Tools/protoc-3.6.1-osx-x86_64/include/google
total 0
drwxr-xr-x 184 nmurthy staff 6256 Nov 7 15:12 protobuf
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
how to install protoc-gen-grpc-web - Stack Overflow
the issue was that i created a directory called "protoc-gen-grpc-web" rather than renaming the binary and placing it directly in bin.
Read more >protoc-gen-grpc-web - Homebrew Formulae
Protoc plugin that generates code for gRPC-Web clients ... Formula JSON API: /api/formula/protoc-gen-grpc-web.json ... Build Errors (30 days).
Read more >Protocol Buffer Compiler Installation - gRPC
You can install the protocol compiler, protoc , with a package manager under Linux or macOS using the following commands.
Read more >protoc-gen-grpc-web: plugin failed with status code 1. - You.com
You'll need to make the protoc-gen-grpc-web plugin executable and move it to a directory that is discoverable from your PATH environment variable.
Read more >Troubleshoot gRPC on .NET Core - Microsoft Learn
NET Core gRPC app on macOS; gRPC C# assets are not code generated from .proto files; WPF projects unable to generate gRPC C#...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh I see, you have the
protoc
binary, but not the protoc library that we can link with-lprotoc
.This is not good user experience, but you will have to manually compile and install the protoc library for now.
In the helloworld example README, here’s the instructions on how to compile and install protoc:
We will be providing pre-compiled binaries for the
protoc-gen-grpc-web
plugin across a few platforms shortly in the future.Posting here for reference because I liked this solution and maybe others will find this useful as well:
@juanjoDiaz created a Docker image that has all the
protoc
binaries baked in: https://github.com/grpc/grpc-web/issues/356#issuecomment-436735632