【发布时间】:2022-07-23 12:50:46
【问题描述】:
我正在尝试在我的 Mac M1 上使用 grpc,并且我已遵循本指南:https://grpc.io/docs/languages/cpp/quickstart/
在我的项目 CmakeLists.txt 我有这个:
find_package(gRPC CONFIG REQUIRED)
当我尝试运行 cmake 时出现此错误:
-- Could NOT find absl (missing: absl_DIR)
CMake Error at CMakeLists.txt:80 (find_package):
Found package configuration file:
/Users/venelin/.local/lib/cmake/grpc/gRPCConfig.cmake
but it set gRPC_FOUND to FALSE so package "gRPC" is considered to be NOT
FOUND. Reason given by package:
The following imported targets are referenced, but are missing: absl::base
absl::core_headers absl::memory absl::random_random absl::status absl::cord
absl::str_format absl::strings absl::synchronization absl::time
absl::optional absl::flat_hash_map absl::inlined_vector absl::bind_front
absl::hash absl::statusor absl::variant absl::utility protobuf::libprotobuf
protobuf::libprotoc
所以我决定这样做:
find_package(absl CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
然后我得到这个错误:
CMake Error at CMakeLists.txt:80 (find_package):
Could not find a package configuration file provided by "absl" with any of
the following names:
abslConfig.cmake
absl-config.cmake
Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
"absl_DIR" to a directory containing one of the above files. If "absl"
provides a separate development package or SDK, be sure it has been
installed.
知道我的错误在哪里,我怎样才能使这个工作正常?
【问题讨论】:
-
根据错误信息,您的机器上没有安装 Abseil 包。