【问题标题】:error "CARES_SIZEOF_LONG & CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"错误“缺少 CARES_SIZEOF_LONG 和 CARES_SIZEOF_ARES_SOCKLEN_T 定义!”
【发布时间】:2020-10-14 17:41:50
【问题描述】:

我正在尝试用 QNX7 for ARM 交叉编译 gRPC。 我正在为 c++ 使用 cmake。

我正在使用以下命令:

我在编译时收到以下错误消息

[ 42%] Building CXX object CMakeFiles/grpc_unsecure.dir/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc.o
[ 42%] Building CXX object CMakeFiles/grpc_unsecure.dir/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc.o
In file included from /usr/include/ares.h:23:0,
                 from /local/mnt/workspace/grpc/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc:23:
/usr/include/ares_rules.h:72:4: error: #error "CARES_SIZEOF_LONG definition is missing!"
 #  error "CARES_SIZEOF_LONG definition is missing!"
    ^
/usr/include/ares_rules.h:82:4: error: #error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"
 #  error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"
    ^

以前有人遇到过这个问题吗?我该如何解决这个问题?

【问题讨论】:

  • 看起来它正在从“/usr/include”中引入标头,这通常是主机系统的一部分(即不是交叉目标)。当写得不好的依赖解析 cmake 片段具有硬编码的搜索路径时,或者当它们调用 pkg-config 等工具而没有设置适当的环境变量时,就会发生这种情况。
  • 是的,你是对的。我试图从系统中删除 cares 库,以便它应该使用交叉编译器 cares 库。

标签: grpc qnx


【解决方案1】:

我试图删除安装在我的 ubuntu 系统中的 cares 库,以便它应该使用交叉编译器 cares 库。

【讨论】:

  • 这解决了问题吗?
  • 是的@apolcyn。它解决了问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多