在Mac OS中安装grpc-cpp时无法使用make命令生成和编译

时间:2019-07-16 16:04:48

标签: c++ macos makefile grpc

我正在尝试在Mac OS中安装grpc C ++。然后按照此link

中的说明进行操作

但是,当我在拉出子模块后从grpc根文件夹运行x <- read.table(header=TRUE, stringsAsFactor=FALSE, text=" ID Type Registered DeRegister P40 Review Yes No P40 Review No No P40 Review No Yes P40 Review Yes No P40 Review No Yes P41 Review Yes No P41 Review No No P41 Review No Yes") 进行构建时,会出现类似以下的错误。

make

在设置LIBTOOL和LIBTOOLIZE环境变量之前,我在命令下面运行

[PROTOC]  Generating protobuf CC file from src/proto/grpc/core/stats.proto
[CXX]     Compiling /Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.cc
In file included from /Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.cc:4:
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:12:2: error: This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
 ^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:13:2: error: incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
 ^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:14:2: error: your headers.
#error your headers.
 ^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:38:1: error: unknown type name 'PROTOBUF_NAMESPACE_OPEN'
PROTOBUF_NAMESPACE_OPEN
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:39:1: error: expected unqualified-id
namespace internal {
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:42:1: error: unknown type name 'PROTOBUF_NAMESPACE_CLOSE'
PROTOBUF_NAMESPACE_CLOSE
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:45:1: error: expected unqualified-id
struct TableStruct_src_2fproto_2fgrpc_2fcore_2fstats_2eproto {
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:73:1: error: unknown type name 'PROTOBUF_NAMESPACE_OPEN'
PROTOBUF_NAMESPACE_OPEN
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:74:1: error: expected unqualified-id
template<> ::grpc::core::Bucket* Arena::CreateMaybeMessage<::grpc::core::Bucket>(Arena*);
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:75:37: error: use of undeclared identifier 'Arena'
template<> ::grpc::core::Histogram* Arena::CreateMaybeMessage<::grpc::core::Histogram>(Arena*);
                                    ^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:76:34: error: use of undeclared identifier 'Arena'
template<> ::grpc::core::Metric* Arena::CreateMaybeMessage<::grpc::core::Metric>(Arena*);
                                 ^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:77:33: error: use of undeclared identifier 'Arena'
template<> ::grpc::core::Stats* Arena::CreateMaybeMessage<::grpc::core::Stats>(Arena*);
                                ^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:78:1: error: unknown type name 'PROTOBUF_NAMESPACE_CLOSE'
PROTOBUF_NAMESPACE_CLOSE
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:79:1: error: expected unqualified-id
namespace grpc {
^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:115:53: error: declaration of 'GetReflection' overrides a 'final' function
  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
                                                    ^
/usr/local/include/google/protobuf/message.h:365:29: note: overridden virtual function is here
  virtual const Reflection* GetReflection() const final {
                            ^
In file included from /Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.cc:4:
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:167:51: error: no class named 'AnyMetadata' in namespace 'google::protobuf::internal'
  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:213:19: error: no struct named 'TableStruct_src_2fproto_2fgrpc_2fcore_2fstats_2eproto' in the global namespace
  friend struct ::TableStruct_src_2fproto_2fgrpc_2fcore_2fstats_2eproto;
                ~~^
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:183:58: error: cannot initialize a parameter of type 'google::protobuf::internal::AssignDescriptorsTable *' with an
      rvalue of type 'const ::google::protobuf::internal::DescriptorTable *'
    ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_src_2fproto_2fgrpc_2fcore_2fstats_2eproto);
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/google/protobuf/generated_message_reflection.h:701:64: note: passing argument to parameter 'table' here
void PROTOBUF_EXPORT AssignDescriptors(AssignDescriptorsTable* table);
                                                               ^
In file included from /Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.cc:4:
/Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.h:184:73: error: no member named 'file_level_metadata' in 'google::protobuf::internal::DescriptorTable'
    return ::descriptor_table_src_2fproto_2fgrpc_2fcore_2fstats_2eproto.file_level_metadata[kIndexInFileMessages];
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [/Users/hareentej22/grpc/objs/opt//Users/hareentej22/grpc/gens/src/proto/grpc/core/stats.pb.o] Error 1

返回了这样的内容

LIBTOOL=glibtool LIBTOOLIZE=glibtoolize make

但是我向前走,并遵循了后续步骤。我还使用brew安装了pkg-config。

在解决此问题方面我需要一些帮助。

0 个答案:

没有答案