小杨哞哞 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日

悬赏问题

  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装
  • ¥40 复杂的限制性的商函数处理