libevent CentOS7 编译
  TEZNKK3IfmPf 2023年11月14日 16 0

安装 libevent 出错: event.c error: 'CLOCK_MONOTONIC' undeclared
checking build system type... configure: error: cannot guess build type; you must specify one
--build=arm-linux
在编译 libevent-1.2 源码时, make 出错:
event.c:157:20: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
                    ^
出错原因是: 在 event.c 文件中 CLOCK_MONOTONIC 没有定义.
解决办法 : 在网上搜了下, 是缺少头文件了, CLOCK_MONOTONIC 定义在 time.h 头文件中. 所以可以直接修改源码:
在 event.c 中引用头文件: #include <time.h> :

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月14日 0

暂无评论

推荐阅读
  TEZNKK3IfmPf   2023年11月14日   16   0   0 CentOS7端口
  TEZNKK3IfmPf   2023年11月14日   15   0   0 CentOS7root
  TEZNKK3IfmPf   2023年11月14日   47   0   0 CentOS7
  TEZNKK3IfmPf   2023年11月14日   22   0   0 CentOS7防火墙
  TEZNKK3IfmPf   2023年11月14日   22   0   0 CentOS7rabbitmq
  TEZNKK3IfmPf   2023年11月12日   21   0   0 CentOS7linux
  TEZNKK3IfmPf   2023年11月14日   17   0   0 CentOS7
TEZNKK3IfmPf