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 ...
随机推荐
- Windows多线程同步系列之一-----互斥对象
多线程同步之互斥对象 作者:vpoet mail:vpoet_sir@163.com 对卖票问题进行线程间同步,本文将在上文的基础上,使用互斥对象对线程进行同步. 首先看看windows API ...
- 如何区分监督学习(supervised learning)和非监督学习(unsupervised learning)
监督学习:简单来说就是给定一定的训练样本(这里一定要注意,样本是既有数据,也有数据对应的结果),利用这个样本进行训练得到一个模型(可以说是一个函数),然后利用这个模型,将所有的输入映射为相应的输出,之 ...
- Unity 代码规范(PlateFace)1.0版本
PlateFace Unity开发规范(1.0) 1.项目都采用英文名命名,图片,音频,资源都不能采用中文. 2.方法名: 帕斯卡命名(所有单词首字母大写) 3.字段: 在Unity中组件字段名第一个 ...
- Android学习总结——实现Home键功能
实现Home键功能简而言之就是回到桌面,让Activity不销毁,程序后台运行. 实现方法: Intent intent= new Intent(Intent.ACTION_MAIN); intent ...
- C# 数据的序列化存取
1,什么是序列化? 序列化 (Serialization)将对象的状态信息转换为可以存储或传输的形式的过程.在序列化期间,对象将其当前状态写入到临时或持久性存储区.以后,可以通过从存储区中读取或反序列 ...
- CATransform3D参数的意义
经常忘记CATransform3D各参数的意思,记下来好好理解下 struct CATransform3D { CGFloat m11(x缩放),m12(y切变),m13(旋转),m14(); C ...
- 【二分答案nlogn/标解O(n)】【UVA1121】Subsequence
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, a ...
- Ascll
ascll - 概述 ASCII码(American Standard Code for Information Interchange, 美国标准信息交换码). 信息编码就是将表示信息的某种符号 ...
- 转:说说JSON和JSONP,也许你会豁然开朗,含jQuery用例
说到AJAX就会不可避免的面临两个问题,第一个是AJAX以何种格式来交换数据?第二个是跨域的需求如何解决?这两个问题目前都有不同的解决方案,比如数据可以用自定义字符串或者用XML来描述,跨域可以通过服 ...
- CSS的base文件常用代码
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,but ...