-1

Tried to install as per grpc quickstart page. Installation of gRPC itself was fine but third-party/abseil-cpp is giving lot of errors ("make -j" step):

#error "C++ versions less than C++11 are not supported."
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:108:15: error: static_assert expression is not an integral constant expression
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/policy_checks.h:77:2: error: "C++ versions less than C++11 are not supported."
#error "C++ versions less than C++11 are not supported."
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:108:15: error: static_assert expression is not an integral constant expression
error: "lts_20210324"
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__config:880:44: note: expanded from #error "C++ versions less than C++11 are not supported."
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:108:15: error: static_assert expression is not an integral constant expression
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:111:15: error: static_assert expression is not an integral constant expression
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:111:15: error: static_assert expression is not an integral constant expression
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/config.h:111:15: error: static_assert expression is not an integral constant expression
/home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/base/internal/fast_type_id.h:28:3: In file included from /home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/absl/random/internal/randen_round_keys.ccerror:: 15:
error: unknown type name 'constexpr'
<truncated>
4

1 回答 1

0

在 /home/guest/grpc/grpc-cpp/grpc/third_party/abseil-cpp/cmake/build/CMakeCache.txt 添加到 CXX_FLAGS 行如下:

//CXX 编译器在所有构建类型中使用的标志。CMAKE_CXX_FLAGS:STRING= --std=c++11

有了这个,“make -j”和“make install”就可以工作了,grpc-cpp 就可以运行了。

于 2021-08-07T10:24:57.423 回答