【问题标题】:“make: protoc: Command not found” while installing grpc from source从源代码安装 grpc 时出现“make: protoc: Command not found”
【发布时间】:2019-01-16 10:35:54
【问题描述】:

我已经克隆了这个存储库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的原因。

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

当我在 grpc 根目录中运行 make 时。我收到此错误

[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 文件。

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

【问题讨论】:

  • 你在哪里手动安装了protoc?我希望在您的PATH 中的路径中?
  • 嗨@MatthieuBrucher 我在.bashrc 中没有设置PATH。这就是你要问的吗?也就是说,我认为 protobuff 安装在某个默认位置,例如 /usr/include/usr/lib64我如何确保它? 当我执行protoc --IPATH 时,它也会给出 Missing value for flag: --IPATH
  • 你必须弄清楚这一点,因为路径却被添加到环境变量PATH。不确定你认为protoc -IPATH 应该做什么。
  • 如果你输入which protoc,它会搜索你的PATH,并告诉你安装在哪里,如果能找到的话。
  • 嗨@NickODell 和@MatthieuBrucher,这绝对是protobuf 安装问题。当我再次重新安装 protobuff 时,这个问题就解决了。显然我下载了错误的 git repo,现在已修复。 由于我是新手,所以我不知道如何在没有任何答案的情况下关闭此问题。

标签: c++ makefile protocol-buffers grpc opensuse


【解决方案1】:

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

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

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

谢谢,

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-24
    • 2019-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-20
    • 2015-09-04
    • 2017-02-12
    相关资源
    最近更新 更多