今天安装libmemcached安装时出错。找了下原因得到解决方法
报错片断
----------------------------------------------------------------------------------------------------------
CC clients/ms_stats.o
CC clients/ms_task.o
CC clients/ms_thread.o
CCLD clients/memslap
clients/ms_conn.o: In function `ms_get_
udp_request_id':
/var/go2packages/libmemcached-0.37/clients/ms_conn.c:184: undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn_socks':
/var/go2packages/libmemcached-0.37/clients/ms_conn.c:1055: undefined reference to `__sync_fetch_and_add_4'
clients/ms_conn.o: In function `ms_reconn':
/var/go2packages/libmemcached-0.37/clients/ms_conn.c:924: undefined reference to `__sync_fetch_and_add_4'
/var/go2packages/libmemcached-0.37/clients/ms_conn.c:960: undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o: In function `ms_setup_thread':
/var/go2packages/libmemcached-0.37/clients/ms_thread.c:215: undefined reference to `__sync_fetch_and_add_4'
clients/ms_thread.o:/var/go2packages/libmemcached-0.37/clients/ms_thread.c:198: more undefined references to `__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status
make[2]: *** [clients/memslap] Error 1
make[2]: Leaving directory `/var/go2packages/libmemcached-0.37'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/go2packages/libmemcached-0.37'
make: *** [all] Error 2
--------------------------------------------------------------------------------------------------------------------------
解决方法:
./configure --disable-64bit CFLAGS="-O3 -march=i686"