我想在 Ubuntu 11 上安装 c_icap 并收到以下错误。
make[2]: Entering directory `/home/madmin/milkyway/sol/server/3rdparty/c_icap-0.1.7/tests'
/bin/bash ../libtool --tag=CC --mode=link gcc -I../include/ -D_REENTRANT -g -O2 -Wall -rdynamic -rpath /usr/local/c_icap/lib -o test_cache test_cache.o **-lpthread** ../libicapapi.la -ldl
libtool: link: gcc -I../include/ -D_REENTRANT -g -O2 -Wall -rdynamic -o .libs/test_cache test_cache.o **-lpthread** ../.libs/libicapapi.so -ldl -Wl,-rpath -Wl,/usr/local/c_icap/lib
../.libs/libicapapi.so: undefined reference to `pthread_rwlock_rdlock'
../.libs/libicapapi.so: undefined reference to `pthread_rwlock_wrlock'
../.libs/libicapapi.so: undefined reference to `pthread_rwlock_unlock'
collect2: ld returned 1 exit status
不知道问题是什么,因为我看到了libicap.so的 objdump并得到了这个
0000000000000000 *UND* 0000000000000000 pthread_rwlock_rdlock
0000000000000000 F *UND* 0000000000000000 pthread_mutex_destroy@@GLIBC_2.2.5
0000000000000000 *UND* 0000000000000000 pthread_rwlock_wrlock
0000000000000000 F *UND* 0000000000000000 pthread_mutex_unlock@@GLIBC_2.2.5
0000000000000000 *UND* 0000000000000000 pthread_rwlock_unlock
这表明 pthread lib 没有丢失,因为 pthread_mutex 符号在 objdump 中被正确解析。还存在 -lpthread 标志。
在 Makefile 我有
THREADS_LDADD = -lpthread
c_icap_LDADD = -lpthread libicapapi.la -ldl
有任何想法吗?