ubuntu 11.10 64bit安装FASTDFS报错的问题
环境:Linux snsfile35 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
报错信息:
root@snsfile35:/data/soft/FastDFS# ./make.sh
nm: '/usr/lib/libc_r.so': No such file
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/hash.o ../common/hash.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/chain.o ../common/chain.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/base64.o ../common/base64.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/shared_func.o ../common/shared_func.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/ini_file_reader.o ../common/ini_file_reader.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/logger.o ../common/logger.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/sockopt.o ../common/sockopt.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/sched_thread.o ../common/sched_thread.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/http_func.o ../common/http_func.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/pthread_func.o ../common/pthread_func.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/md5.o ../common/md5.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_proto.o tracker_proto.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_mem.o tracker_mem.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_service.o tracker_service.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_status.o tracker_status.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_global.o tracker_global.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_func.o tracker_func.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o fast_task_queue.o fast_task_queue.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_nio.o tracker_nio.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_dump.o tracker_dump.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/linux_stack_trace.o ../common/linux_stack_trace.c -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -o fdfs_trackerd fdfs_trackerd.c ../common/hash.o ../common/chain.o ../common/base64.o ../common/shared_func.o ../common/ini_file_reader.o ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o ../common/sched_thread.o ../common/http_func.o ../common/pthread_func.o ../common/md5.o tracker_proto.o tracker_mem.o tracker_service.o tracker_status.o tracker_global.o tracker_func.o fast_task_queue.o tracker_nio.o tracker_dump.o ../common/linux_stack_trace.o -L/usr/local/lib -ldl -rdynamic -levent -I../common -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/local_ip_func.o ../common/local_ip_func.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o tracker_client_thread.o tracker_client_thread.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_global.o storage_global.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_func.o storage_func.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_service.o storage_service.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_sync.o storage_sync.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_nio.o storage_nio.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_dio.o storage_dio.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_ip_changed_dealer.o storage_ip_changed_dealer.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_param_getter.o storage_param_getter.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_disk_recovery.o storage_disk_recovery.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../client/client_global.o ../client/client_global.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../client/tracker_client.o ../client/tracker_client.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../client/storage_client.o ../client/storage_client.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../client/client_func.o ../client/client_func.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o fdht_client/fdht_proto.o fdht_client/fdht_proto.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o fdht_client/fdht_client.o fdht_client/fdht_client.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o fdht_client/fdht_func.o fdht_client/fdht_func.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o fdht_client/fdht_global.o fdht_client/fdht_global.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o storage_dump.o storage_dump.c -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -o fdfs_storaged fdfs_storaged.c ../common/hash.o ../common/chain.o ../common/shared_func.o ../common/ini_file_reader.o ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o ../common/base64.o ../common/sched_thread.o ../common/local_ip_func.o ../common/http_func.o ../common/md5.o ../common/pthread_func.o ../tracker/tracker_proto.o ../tracker/fast_task_queue.o tracker_client_thread.o storage_global.o storage_func.o storage_service.o storage_sync.o storage_nio.o storage_dio.o storage_ip_changed_dealer.o storage_param_getter.o storage_disk_recovery.o ../client/client_global.o ../client/tracker_client.o ../client/storage_client.o ../client/client_func.o fdht_client/fdht_proto.o fdht_client/fdht_client.o fdht_client/fdht_func.o fdht_client/fdht_global.o storage_dump.o ../common/linux_stack_trace.o -L/usr/local/lib -ldl -rdynamic -levent -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/mime_file_parser.o ../common/mime_file_parser.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -o ../common/fdfs_http_shared.o ../common/fdfs_http_shared.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/hash.lo ../common/hash.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/chain.lo ../common/chain.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/shared_func.lo ../common/shared_func.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/ini_file_reader.lo ../common/ini_file_reader.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/logger.lo ../common/logger.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/sockopt.lo ../common/sockopt.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/base64.lo ../common/base64.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/sched_thread.lo ../common/sched_thread.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/http_func.lo ../common/http_func.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/md5.lo ../common/md5.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/pthread_func.lo ../common/pthread_func.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/local_ip_func.lo ../common/local_ip_func.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/fdfs_global.lo ../common/fdfs_global.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/fdfs_http_shared.lo ../common/fdfs_http_shared.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../common/mime_file_parser.lo ../common/mime_file_parser.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o ../tracker/tracker_proto.lo ../tracker/tracker_proto.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o tracker_client.lo tracker_client.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o client_func.lo client_func.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o client_global.lo client_global.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -c -fPIC -o storage_client.lo storage_client.c -I../common -I../tracker -I/usr/local/include
cc -Wall -O -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG -DOS_LINUX -o fdfs_monitor fdfs_monitor.c ../common/hash.o ../common/chain.o ../common/shared_func.o ../common/ini_file_reader.o ../common/logger.o ../common/sockopt.o ../common/fdfs_global.o ../common/base64.o ../common/sched_thread.o ../common/http_func.o ../common/mime_file_parser.o ../common/fdfs_http_shared.o ../common/md5.o ../common/pthread_func.o ../common/local_ip_func.o ../tracker/tracker_proto.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/local/lib -ldl -rdynamic -I../common -I../tracker -I/usr/local/include
../common/sched_thread.o: In function `sched_start':
/data/soft/FastDFS/tracker/../common/sched_thread.c:240: undefined reference to `pthread_create'
../common/pthread_func.o: In function `init_pthread_lock':
/data/soft/FastDFS/tracker/../common/pthread_func.c:32: undefined reference to `pthread_mutexattr_init'
/data/soft/FastDFS/tracker/../common/pthread_func.c:40: undefined reference to `pthread_mutexattr_settype'
/data/soft/FastDFS/tracker/../common/pthread_func.c:57: undefined reference to `pthread_mutexattr_destroy'
../common/pthread_func.o: In function `init_pthread_attr':
/data/soft/FastDFS/tracker/../common/pthread_func.c:84: undefined reference to `pthread_attr_getstacksize'
/data/soft/FastDFS/tracker/../common/pthread_func.c:115: undefined reference to `pthread_attr_setstacksize'
../common/pthread_func.o: In function `create_work_threads':
/data/soft/FastDFS/tracker/../common/pthread_func.c:156: undefined reference to `pthread_create'
../common/pthread_func.o: In function `kill_work_threads':
/data/soft/FastDFS/tracker/../common/pthread_func.c:182: undefined reference to `pthread_kill'
collect2: ld returned 1 exit status
make: *** [fdfs_monitor] Error 1
root@snsfile35:/data/soft/FastDFS#
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
回复 1# wbteve
缺少pthread库。
这个问题其实不是缺少pthread库,参看以下帖子:
http://ubuntuforums.org/showthread.php?p=11400708
回复 1# wbteve
make.sh中找到这句:
if [ -f /usr/lib/libpthread.so ] || [ -f /usr/local/lib/libpthread.so ] || [ -f /usr/lib64/libpthread.so ] || [ -f /usr/lib/libpthread.a ] || [ -f /usr/local/lib/libpthread.a ] || [ -f /usr/lib64/libpthread.a ]; then
LIBS="$LIBS -lpthread"
是因为这里面的libpthread.so这个库路径不对,我也遇到过这个问题,把正确的路径加进来就可以了。
回复 4# wwww6662003
挺好,顶!
回复 5# happy_fish100
向 happy_fish100 老师学习!
快速解决办法:
第一步安装这个 sudo apt-get install libpthread-workqueue-dev
第二步做个链接 sudo ln -s /usr/lib/libpthread-workqueue.so /usr/lib/libpthread.so
打完收工~~~~
楼主你好,这两天我也尝试在ubuntu 11.10 64bit上安装FastDFS,关于pthread的问题我已经按照你们上面写的方法解决了,但还有很多问题无法解决,能否留个qq什么的联系方式,求指导啊,非常感谢。
本帖最后由 happy_fish100 于 2012-03-08 16:51 编辑
加入FastDFS技术交流群吧,群号:212801927
谢谢fish哥