【问题标题】:Compile Error When compile gRPC that `‘-std=c++11’ is valid for C++/ObjC++ but not for C编译错误当编译 gRPC 时,`'-std=c++11' 对 C++/ObjC++ 有效,但对 C 无效
【发布时间】:2019-02-27 10:24:51
【问题描述】:

我正在尝试编译grpc_python_plugin。我在 Github 上下载了最新的 grpc 包。按照提示进入grpc目录,开始编译

make grpc_python_plugin

,并得到以下错误:

wcf@wcf-OptiPlex-7060:~/resq/grpc$ make grpc_python_plugin
[C]       Compiling third_party/address_sorting/address_sorting.c
cc1: error: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [-Werror]
cc1: all warnings being treated as errors
Makefile:2972: recipe for target '/home/wcf/resq/grpc/objs/opt/third_party/address_sorting/address_sorting.o' failed
make: *** [/home/wcf/resq/grpc/objs/opt/third_party/address_sorting/address_sorting.o] Error 1

由于grpcMakefile 如此庞大,我找不到任何解决问题的方法。你能就我的问题分享一些想法吗?感谢您的时间。

【问题讨论】:

  • 您的 makefile 似乎在调用 C 编译器而不是 C++ 编译器。或者你可能需要-std=c11 而不是c++11
  • 你可以看看grpc的Makefile,它有20000多行。目前还不清楚会发生什么。

标签: c++11 compiler-errors grpc


【解决方案1】:

问题可能是我在grpc git 程序之外安装了protobuf。当我在grpcthird_party 中安装protobuf 时。一切顺利。

【讨论】:

    【解决方案2】:

    我使它工作的方式是从 Makefile 中的 CPPFLAGS 中删除“-Werror”。但是,是的,我还在 grpc 之外安装了 protobuf。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-12
      • 2018-05-12
      • 1970-01-01
      • 1970-01-01
      • 2013-12-09
      • 2017-04-09
      相关资源
      最近更新 更多