因为yum没法安装libev,我们首先在csdn的下载资源中找到libev的下载地址,我找的是http://download.youkuaiyun.com/detail/ncepubdtb/6513325#comment
1. tar -zxvf libev-4.15 解压
2. ./configure生成makefile文件
3. make
4. make install【libev这个库编译好以后会自动添加到/usr/local/lib目录下】
在make我的代码成功后出现了这个错误:error while loading shared libraries: libev.so.4:cannot open shared object file: No such file or directory
解决办法有以下几种【因为安装目录不同,个人使用方法3,比较简单】
1 在安装的时候制定路径 ./configure –prefix=/usr
2 做一个软连接
ln -s /usr/local/lib/libev.so.4 /usr/lib/libev.so.4
ldconfig
3 设置动态库路径
export LD_LIBRARY_PATH="/usr/local/lib"
4 vi /etc/ld.so.conf
添加
/usr/local/lib
5 关闭后,运行 ldconfig
解决办法转载自:http://blog.chinaunix.net/uid-192452-id-4585352.html
这里有一篇更为详细的libev教程,里面包含了libev的一些讲解。
http://blog.youkuaiyun.com/wudishine/article/details/43672675