小杨哞哞 2023-03-30 22:40 采纳率: 100%
浏览 19
已结题

centos7安装libevent,make时报错

问题遇到的现象和发生背景

安装libevent-2.1.12-stable,make时报错

In file included from sample/dns-example.c:8:
./include/event2/event-config.h:559:15: error: two or more data types in declaration specifiers
  559 | #define pid_t int
      |               ^~~
./include/event2/event-config.h:568:17: error: two or more data types in declaration specifiers
  568 | #define ssize_t int
      |                 ^~~
./include/event2/event-config.h:562:16: error: duplicate ‘unsigned’
  562 | #define size_t unsigned int
      |                ^~~~~~~~
./include/event2/event-config.h:562:25: error: two or more data types in declaration specifiers
  562 | #define size_t unsigned int
      |                         ^~~
./include/event2/event-config.h:565:19: error: two or more data types in declaration specifiers
  565 | #define socklen_t unsigned int
      |                   ^~~~~~~~
./include/event2/event-config.h:565:28: error: two or more data types in declaration specifiers
  565 | #define socklen_t unsigned int
      |                            ^~~
In file included from sample/../ipv6-internal.h:40,
                 from sample/dns-example.c:11:
./include/event2/util.h:129:2: error: #error "No way to define ev_uint64_t"
  129 | #error "No way to define ev_uint64_t"
      |  ^~~~~
./include/event2/util.h:148:2: error: #error "No way to define ev_uint32_t"
  148 | #error "No way to define ev_uint32_t"
      |  ^~~~~
./include/event2/util.h:167:2: error: #error "No way to define ev_uint16_t"
  167 | #error "No way to define ev_uint16_t"
      |  ^~~~~
./include/event2/util.h:283:2: error: #error "No way to define SIZE_MAX"
  283 | #error "No way to define SIZE_MAX"
      |  ^~~~~
./include/event2/util.h:582:1: error: unknown type name ‘ev_int64_t’; did you mean ‘u_int64_t’?
  582 | ev_int64_t evutil_strtoll(const char *s, char **endptr, int base);
      | ^~~~~~~~~~
      | u_int64_t
In file included from sample/dns-example.c:11:
sample/../ipv6-internal.h:53:8: error: redefinition of ‘struct in6_addr’
   53 | struct in6_addr {
      |        ^~~~~~~~
In file included from /usr/include/netdb.h:27,
                 from ./include/event2/util.h:61,
                 from sample/../ipv6-internal.h:40,
                 from sample/dns-example.c:11:
/usr/include/netinet/in.h:212:8: note: originally defined here
  212 | struct in6_addr
      |        ^~~~~~~~
sample/../ipv6-internal.h:54:13: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
   54 |  ev_uint8_t s6_addr[16];
      |             ^~~~~~~
In file included from sample/dns-example.c:11:
sample/../ipv6-internal.h:59:13: error: conflicting types for ‘sa_family_t’
   59 | typedef int sa_family_t;
      |             ^~~~~~~~~~~
In file included from /usr/include/bits/socket.h:151,
                 from /usr/include/sys/socket.h:39,
                 from sample/../ipv6-internal.h:38,
                 from sample/dns-example.c:11:
/usr/include/bits/sockaddr.h:28:28: note: previous declaration of ‘sa_family_t’ was here
   28 | typedef unsigned short int sa_family_t;
      |                            ^~~~~~~~~~~
In file included from sample/dns-example.c:11:
sample/../ipv6-internal.h:63:8: error: redefinition of ‘struct sockaddr_in6’
   63 | struct sockaddr_in6 {
      |        ^~~~~~~~~~~~
In file included from /usr/include/netdb.h:27,
                 from ./include/event2/util.h:61,
                 from sample/../ipv6-internal.h:40,
                 from sample/dns-example.c:11:
/usr/include/netinet/in.h:255:8: note: originally defined here
  255 | struct sockaddr_in6
      |        ^~~~~~~~~~~~
In file included from sample/dns-example.c:11:
sample/../ipv6-internal.h:67:2: error: unknown type name ‘ev_uint16_t’
   67 |  ev_uint16_t sin6_port;
      |  ^~~~~~~~~~~
In file included from sample/dns-example.c:29:
./include/event2/event.h:775:33: error: unknown type name ‘ev_uint32_t’; did you mean ‘ev_uint8_t’?
  775 | void event_enable_debug_logging(ev_uint32_t which);
      |                                 ^~~~~~~~~~~
      |                                 ev_uint8_t
./include/event2/event.h:1431:1: error: unknown type name ‘ev_uint32_t’; did you mean ‘ev_uint8_t’?
 1431 | ev_uint32_t event_get_version_number(void);
      | ^~~~~~~~~~~
      | ev_uint8_t
In file included from sample/dns-example.c:30:
./include/event2/dns.h:588:34: error: unknown type name ‘ev_uint16_t’; did you mean ‘ev_uint8_t’?
  588 | void evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void));
      |                                  ^~~~~~~~~~~
      |                                  ev_uint8_t
sample/dns-example.c:42:13: error: unknown type name ‘ev_uint32_t’; did you mean ‘ev_uint8_t’?
   42 | #define u32 ev_uint32_t
      |             ^~~~~~~~~~~
sample/dns-example.c:46:12: note: in expansion of macro ‘u32’
   46 | debug_ntoa(u32 address)
      |            ^~~
sample/dns-example.c: In function ‘main_callback’:
sample/dns-example.c:65:26: warning: implicit declaration of function ‘debug_ntoa’ [-Wimplicit-function-declaration]
   65 |    printf("%s: %s\n", n, debug_ntoa(((u32*)addrs)[i]));
      |                          ^~~~~~~~~~
sample/dns-example.c:65:26: warning: nested extern declaration of ‘debug_ntoa’ [-Wnested-externs]
sample/dns-example.c:42:13: error: ‘ev_uint32_t’ undeclared (first use in this function); did you mean ‘ev_uint8_t’?
   42 | #define u32 ev_uint32_t
      |             ^~~~~~~~~~~
sample/dns-example.c:65:39: note: in expansion of macro ‘u32’
   65 |    printf("%s: %s\n", n, debug_ntoa(((u32*)addrs)[i]));
      |                                       ^~~
sample/dns-example.c:42:13: note: each undeclared identifier is reported only once for each function it appears in
   42 | #define u32 ev_uint32_t
      |             ^~~~~~~~~~~
sample/dns-example.c:65:39: note: in expansion of macro ‘u32’
   65 |    printf("%s: %s\n", n, debug_ntoa(((u32*)addrs)[i]));
      |                                       ^~~
sample/dns-example.c:65:43: error: expected expression before ‘)’ token
   65 |    printf("%s: %s\n", n, debug_ntoa(((u32*)addrs)[i]));
      |                                           ^
操作环境、软件版本等信息

centos7,openssl-devel-1.0.2k-26.el7_9.x86_64

  • 写回答

1条回答 默认 最新

  • callinglove 2023-03-31 08:38
    关注

    在centos7试了一下编译,很顺畅,没出现你说的这种情况
    你把解压出来的源码目录删除,重新cmake一下,然后make试试吧

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 4月8日
  • 已采纳回答 3月31日
  • 创建了问题 3月30日

悬赏问题

  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事: