从源代码安装 grpc 时出现“make: protoc: Command not found”

“make: protoc: Command not found” while installing grpc from source

我已经克隆了这个存储库 https://github.com/grpc/grpc.git 用于安装 grpc。我想将框架与 C++ 编程一起使用,所以我按照文件夹 src/cpp.

中给出的说明进行操作

要从源代码(在 OpenSUSE 中)为 C++ 构建 grpc,有一些先决条件 given in this link

 $ [sudo] apt-get install build-essential autoconf libtool pkg-config

如前所述,要从源代码构建和 运行 测试,需要

$ [sudo] apt-get install libgflags-dev libgtest-dev
$ [sudo] apt-get install clang libc++-dev

我找不到任何 build-essentiallibgflags-devlibgtest-dev。不知道是不是grpc安装不上的原因

后来, 我在 运行 之前手动安装了协议缓冲区编译器 protoc make

当我运行make在grpc根目录下。我得到这个错误

[PROTOC]  Generating protobuf CC file from src/proto/grpc/channelz/channelz.proto
make: protoc: Command not found
make: *** [Makefile:2601: /home/rohan/Downloads/grpc/gens/src/proto/grpc/channelz/channelz.pb.cc] Error 127

我已经安装了 protoc,无法弄清楚为什么会显示此错误。是链接问题,请分享解决方法。我是 Linux 的新手,所以我真的有点犹豫要不要更改 env 文件或我自己的一些 make 文件。

请提供一些帮助。感谢您的宝贵时间。

我已经通过正确安装协议缓冲区编译器解决了这个问题。

我之前忘记做的重要步骤是在使用 git 存储库构建协议时使用 git submodule update --init --recursive 更新子模块。

C++ 版本的步骤在 this link 中提到。

谢谢,