cmake - 找不到由“Protobuf”提供的具有以下任何名称的包配置文件: ProtobufConfig.cmake protobuf-config.cmake
问题描述
尝试为 GRPC 编译快速入门示例。
它会产生以下错误:
CMake Error at /home/priya/grpc/examples/cpp/cmake/common.cmake:101 (find_package):
Could not find a package configuration file provided by "Protobuf" with any
of the following names:
ProtobufConfig.cmake
protobuf-config.cmake
Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
"Protobuf_DIR" to a directory containing one of the above files. If
"Protobuf" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:24 (include)
我已经在其他类似问题上尝试了所有建议的解决方案,但无济于事。这些是对我不起作用的解决方案:
- 更改
find_package(protobuf CONFIG REQUIRED)
为大写find_package(Protobuf REQUIRED)
- 安装 pkg-config
- 这个线程
我找不到任何其他解决方案。任何帮助将不胜感激。
解决方案
我猜这很可能是由于 gRPC 存储库中缺少子模块造成的。你会在构建之前获得子模块吗?例如,您可以git clone --recurse-submodules -b v1.38.0 https://github.com/grpc/grpc
为它运行。
推荐阅读
- angularjs - 这个 AngularJS 过滤器是如何工作的?给我一些描述
- asynchronous - 在 vue nuxt 中使用异步数据启动数据
- material-ui - 如何在本地运行 material-ui
- image - 如何对 Rust Piston 图像进行编码并在内存中获取结果?
- jenkins - 从 Jenkins 自动通过电子邮件发送 Katalon 测试结果
- c - 从特定 ip 和端口发送网络流量,而不使用 recvfrom 或接受
- r - purrr - 提取数据帧的行作为向量
- c# - C# Modbus RTU 读取数据长度不同
- python - 为每个单独的条添加标签
- javascript - 是否可以异步运行 WebAssembly 代码?