作者 : Bun Wong
日期 : 2010年06月11日
标签 : Unix / Linux
浏览 : 1689 次
评论 : 0 个
http://www.hdwong.com/article/libmemcached-compile-error.html

libmemcached 编译错误

技术交流 @ 2010年06月11日 收藏&分享

今天在一台主机上编译 memcached 的客户端库 libmemcached,./configure 配置结果如下

---
Configuration summary for libmemcached version 0.40

   * Installation prefix:       /usr/local
   * System type:               pc-linux-gnu
   * Host CPU:                  i686
   * C Compiler:                gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
   * Assertions enabled:        yes
   * Debug enabled:             no
   * Warnings as failure:       no

---

在运行编译后,出现如下错误

clients/ms_conn.o: In function `ms_get_udp_request_id':
/root/libmemcached-0.40/clients/ms_conn.c:194: undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn_socks':
/root/libmemcached-0.40/clients/ms_conn.c:1051: undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn':
/root/libmemcached-0.40/clients/ms_conn.c:919: undefined reference to `__sync_fetch_and_add_4'
/root/libmemcached-0.40/clients/ms_conn.c:956: undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o: In function `ms_setup_thread':
/root/libmemcached-0.40/clients/ms_thread.c:225: undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o:/root/libmemcached-0.40/clients/ms_thread.c:208: more undefined references to `__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status

估计是服务器 i386 和 i686 的关系,Google 后通过配置命令解决

./configure --disable-64bit CFLAGS="-O3 -march=i686"

评论 (0)

还没有评论

* 昵称:

* 评论:

* 验证码: (请输入下图的 4 位数字)

Captcha看不请, 换一张

© 2011 Bun Wong

本博客基于 Bun PHP Framework 构建 • 粤ICP备07036370号