安装libevent报错

icemanjc 2015-10-09 02:54:37
在Linux虚拟机上安装libevent 的时候make 报错:

[admin@localhost libevent-1.3]$ make
make all-recursive
make[1]: Entering directory `/home/admin/Downloads/libevent-1.3'
Making all in .
make[2]: Entering directory `/home/admin/Downloads/libevent-1.3'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat -g -O2 -Wall -c -o event.lo event.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat -g -O2 -Wall -c event.c -fPIC -DPIC -o .libs/event.o
event.c: In function 'gettime':
event.c:156:2: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
^
event.c:156:20: error: 'CLOCK_REALTIME' undeclared (first use in this function)
if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
^
event.c:156:20: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [event.lo] Error 1
make[2]: Leaving directory `/home/admin/Downloads/libevent-1.3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/admin/Downloads/libevent-1.3'
make: *** [all] Error 2

这是什么原因啊求指教????
...全文
517 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhxianbin 2015-10-09
  • 打赏
  • 举报
回复
看看有没有 #include <time.h>

18,773

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧