magent编译安装及常见错误
安装magent到/usr/local/下
cd /usr/local
mkdir magent
cd magent/
wget http://memagent.googlecode.com/files/magent-0.6.tar.gz
tar zxvf magent-0.6.tar.gz
/sbin/ldconfig
sed -i "s#LIBS = -levent#LIBS = -levent -lm#g" Makefile
make
错误1:
gcc -lrt -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c
magent.c: In function ‘writev_list’:
magent.c:729: error: ‘SSIZE_MAX’ undeclared (first use in this function)
magent.c:729: error: (Each undeclared identifier is reported only once
magent.c:729: error: for each function it appears in.)
make: *** [magent.o] Error 1
解决的方法:
vi ketama.h
在开头增加
#ifndef SSIZE_MAX
# define SSIZE_MAX 32767
#endif
错误2:
gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c
gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o ketama.o ketama.c
gcc -Wall -g -O2 -I/usr/local/include -m64 -o magent magent.o ketama.o /usr/lib64/libevent.a /usr/lib64/libm.a
/usr/lib64/libevent.a(event.o): In function `gettime’:
(.text+0×449): undefined reference to `clock_gettime’
/usr/lib64/libevent.a(event.o): In function `event_base_new’:
(.text+0x72a): undefined reference to `clock_gettime’
collect2: ld returned 1 exit status
make: *** [magent] Error 1
解决的方法
vim Makefile
CFLAGS = -Wall -g -O2 -I/usr/local/include $(M64)
改为:
CFLAGS = -lrt -Wall -g -O2 -I/usr/local/include $(M64)
错误3:centos 6
[root@test magent]# make
gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c
gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o ketama.o ketama.c
gcc -Wall -g -O2 -I/usr/local/include -m64 -o magent magent.o ketama.o /usr/lib64/libevent.a /usr/lib64/libm.a
gcc: /usr/lib64/libm.a:没有那个文件或文件夹
make: *** [magent] 错误 1
解决的方法
ln -s /usr/lib64/libm.so /usr/lib64/libm.a
注:有可能还会报错 gcc: /usr/lib64/libevent.a: 没有那个文件或文件夹
假设有,可运行
vi Makefile
找到 LIBS = /usr/lib64/libevent.a /usr/lib64/libm.a
改动 LIBS = /usr/libevent 的安装路径/libevent.a /usr/lib64/libm.a
例: LIBS = /usr/lib/libevent.a /usr/lib64/libm.a
查看magent是否成功安装
cd usr/bin/magent ./magent
please provide -s "ip:port" argument
memcached agent v0.6 Build-Date: Oct 15 2012 16:12:30
Usage:
-h this message
-u uid
-g gid
-p port, default is 11211. (0 to disable tcp support)
-s ip:port, set memcached server ip and port
-b ip:port, set backup memcached server ip and port
-l ip, local bind ip address, default is 0.0.0.0
-n number, set max connections, default is 4096
-D don't go to background
-k use ketama key allocation algorithm
-f file, unix socket path to listen on. default is off
-i number, set max keep alive connections for one memcached server, default is 20
-v verbose
magent编译安装及常见错误的更多相关文章
- PHP编译安装时常见错误解决办法,php编译常见错误
PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt & ...
- 编译安装Heartbeat常见错误
-----------那些需要升级包还有少包的错误就不写了---------- <b>1</b>. Reusable-Cluster-Components-glue-glue- ...
- Lnmp 源码编译安装、常见错误整理
简介: Lnmp 环境的搭建还是非常简单的,之前由于博客迁移等原因,导致丢失了好多博文,这次重新整理记录一下. Lnmp 即:Linux .Nginx .Mysql .PHP Lnmp 是一套 Web ...
- 7.2.*PHP编译安装时常见错误解决办法,php编译常见错误
configure: error: Cannot find ldap.h 检查下面是不是已经安装,如果没有安装之:检查:yum list openldapyum list openldap-dev ...
- 【转】ubuntu源码编译安装php常见错误解决办法
./configure -prefix=/usr/local/php -with-config-file-path=/etc -with-mysql=mysqlnd -with-mysqli=mysq ...
- PHP编译安装时常见错误及解决办法,大全
1. configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution ...
- linux编译安装时常见错误解决办法
This article is post on https://coderwall.com/p/ggmpfa 原文链接:http://www.bkjia.com/PHPjc/1008013.html ...
- CentOS编译安装PHP常见错误及解决办法
1.configure: error: No curses/termcap library found yum -y install ncurses-devel 2.configure: error: ...
- PHP编译安装时常见错误解决办法
转载自:http://www.bkjia.com/PHPjc/1008013.html This article is post on https://coderwall.com/p/ggmpfa c ...
随机推荐
- Sublime Text 3 乱码解决
步骤: 在Sublime Text里,按ctrl+`,打开Console,一次性输入如下代码: import urllib.request,os; pf = 'Package Control.subl ...
- actionInvocation
1.actionInvocation是什么 ActionInvocation就是Action的调用者.ActionInvocation在Action的执行过程中,负责Interceptor.Actio ...
- SQL Server2008R2安装失败问题之语言包问题
今天安装SQL Server2008 的时候出现了,如下的的问题,安装过程在ExcuteStandardTimingsWorkflow时候报错,结束安装. 提示: ...
- Eclipse关联Java源代码
一个很简单的技巧,不多说,直接贴图 1. 2 . 3.选择你jdk下的src.zip就可以了.搞定!
- 容器vector的使用总结 容器stack(栈)
0.头文件:#include<vector>; using namespace std; 1.定义: vector<type> vec; 2.迭代器 vector<typ ...
- AngularJS 中的 Promise 和 设计模式
解决 Javascript 异步事件的传统方式是回调函数:调用一个方法,然后给它一个函数引用,当这个方法完结的时候执行这个函数引用. <!-- lang: js --> $.get('ap ...
- js 控制不能输入空格
onkeydown="if(event.keyCode==32) return false"
- LogBoy 之Android Studio控制台输出日志太多清空
在使用Android studio的时候,有时候会由于手机输出的日志太多,导致控制台瞬间清空,尤其是遇见一些FATAL Exception时候,瞬间控制台就被清空了,根本捕获不到,导致其他调试的日志也 ...
- Android 底部Dialog显示
public void showComplainDialog() { ComplainDialog complain_dialog = new ComplainDialog(OrderDetialAc ...
- 关于微信小程序的一些思考
### 怎么样理解小程序? * 微信的重点产品* 一个事实OS,目前并不知道小程序的入口在哪里?* 小程序的入口可能在如下三个地方: 1. 发现入口 2. 扫码 3. 搜索框 * 小程序没有关注, 意 ...