memcache集群安装magent代理服务错误
[root@test magent]# ls
magent-0.6.tar.gz
[root@test magent]# tar zxvf magent-0.6.tar.gz
ketama.c
ketama.h
magent.c
Makefile
[root@test magent]# /sbin/ldconfig
[root@test magent]# sed -i "s#LIBS=-levent#LIBS=-levent -lm#g" Makefile
[root@test magent]# make
gcc -Wall -g -O2 -I/usr/local/include -c -o magent.o magent.c
magent.c:71:19: error: event.h: No such file or directory
magent.c:130: error: field ‘ev’ has incomplete type
magent.c:161: error: field ‘ev’ has incomplete type
magent.c: In function ‘server_free’:
magent.c:494: warning: implicit declaration of function ‘event_del’
magent.c: In function ‘pool_server_handler’:
magent.c:514: error: ‘EV_READ’ undeclared (first use in this function)
magent.c:514: error: (Each undeclared identifier is reported only once
magent.c:514: error: for each function it appears in.)
magent.c: In function ‘put_server_into_pool’:
magent.c:601: warning: implicit declaration of function ‘event_set’
magent.c:601: error: ‘EV_READ’ undeclared (first use in this function)
magent.c:601: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c:602: warning: implicit declaration of function ‘event_add’
magent.c: In function ‘out_string’:
magent.c:800: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c:803: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c: In function ‘start_update_backupserver’:
magent.c:919: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c:920: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c:920: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c: In function ‘do_transcation’:
magent.c:1006: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c:1041: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c:1041: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c: In function ‘try_backup_server’:
magent.c:1105: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c:1154: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c:1154: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c: In function ‘drive_memcached_server’:
magent.c:1173: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c:1225: error: ‘EV_READ’ undeclared (first use in this function)
magent.c:1227: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c: In function ‘process_get_response’:
magent.c:1402: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c:1404: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c: In function ‘process_update_response’:
magent.c:1450: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c:1452: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c: In function ‘drive_backup_server’:
magent.c:1473: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c:1517: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c:1517: error: ‘EV_READ’ undeclared (first use in this function)
magent.c: In function ‘drive_client’:
magent.c:1797: error: ‘EV_READ’ undeclared (first use in this function)
magent.c:1852: error: ‘EV_WRITE’ undeclared (first use in this function)
magent.c:1865: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c: In function ‘server_accept’:
magent.c:1918: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c:1919: error: ‘EV_READ’ undeclared (first use in this function)
magent.c:1919: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c: In function ‘main’:
magent.c:2310: warning: implicit declaration of function ‘event_init’
magent.c:2315: error: ‘EV_READ’ undeclared (first use in this function)
magent.c:2315: error: ‘EV_PERSIST’ undeclared (first use in this function)
magent.c:2326: warning: implicit declaration of function ‘evtimer_set’
magent.c:2330: warning: implicit declaration of function ‘event_loop’
make: *** [magent.o] Error 1
[root@test magent]#
先安装了libevent-2.0.20-stable.tar.gz。
运行ls -al /usr/lib|grep libevent
结果只有:
[root@test tools]# ls -al /usr/lib | grep libevent
lrwxrwxrwx 1 root root 32 Nov 1 02:02 libevent-2.0.so.2 -> /usr/local/lib/libevent-2.0.so.2
然后安装了memcache。
写java测试类,测试存取数据,。正确。、
然后安装magent抱如上错误。
然后按照第一个找不到文件,更改文件中指定的路劲。
之后报错:
[root@localhost magent]# sed -i "s#LIBS = -levent#LIBS = -levent -lm#g" Makefile
[root@localhost magent]# make
gcc -Wall -O2 -g -c -o magent.o magent.c
magent.c:123: error: field ‘ev’ has incomplete type
magent.c:153: error: field ‘ev’ has incomplete type
magent.c: In function ‘put_server_into_pool’:
magent.c:521: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c: In function ‘out_string’:
magent.c:698: warning: implicit declaration of function ‘event_set’
magent.c: In function ‘do_transcation’:
magent.c:815: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c: In function ‘start_backup_transcation’:
magent.c:901: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c: In function ‘try_backup_server’:
magent.c:993: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c: In function ‘server_accept’:
magent.c:1733: error: invalid application of ‘sizeof’ to incomplete type ‘struct event’
magent.c: In function ‘main’:
magent.c:2105: warning: implicit declaration of function ‘event_init’
magent.c:2120: warning: implicit declaration of function ‘event_loop’
make: *** [magent.o] Error 1
[root@localhost magent]#
麻烦大家帮我分析下。什么问题造成的。
谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我的makefile 文件在这http://hi.baidu.com/chatcoco/item/1734e1e6fb47cc2b86d9def6
我的makefile 文件在这http://hi.baidu.com/chatcoco/item/1734e1e6fb47cc2b86d9def6
我们boss 帮我解决了,引入库的问题,修改下makefile
没有解决。最后采用Eachae集群了!
不知道楼上的解决了没啊,我也碰到了