1.下载
http://download.youkuaiyun.com/detail/sauphy/9314091
2. 编译
./configure --prefix=/opt/libevent
make
make install
3. 开发编译
gcc test_signal.c -o ok -I/opt/libevent/include -L/opt/libevent/lib -levent
./ok
3-1、连接出错:
error while loading shared libraries:
libevent-2.0.so.5: cannot open shared object file: No such file or directory
A1、
ln -s /opt/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
4. 运行
./ok
http://download.youkuaiyun.com/detail/sauphy/9314091
2. 编译
./configure --prefix=/opt/libevent
make
make install
3. 开发编译
gcc test_signal.c -o ok -I/opt/libevent/include -L/opt/libevent/lib -levent
./ok
3-1、连接出错:
error while loading shared libraries:
libevent-2.0.so.5: cannot open shared object file: No such file or directory
A1、
ln -s /opt/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
4. 运行
./ok
Ctrl+C 运行(显示两个信号)
===============================
#include <sys/types.h>
#include <event2/event-config.h>
#include <sys/stat.h>
#ifndef WIN32
#include <sys/queue.h>
#include <unistd.h>
#include <sys/time.h>
#else
#include <winsock2.h>
#include <windows.h>
#endif
#include <signal.h>
#include <fcntl.h>
#include <stdlib.h