ubuntu执行make.sh失败问题

安装完 FastDFS以后,执行make.sh命令结果报错,如下:
  1. /home/FastDFS/FastDFS/tracker/../common/sched_thread.c:493: undefined reference to `pthread_create' ../common/pthread_func.o:   
  2. In function `init_pthread_lock': /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:32: undefined reference to `pthread_mutexattr_init'   
  3. /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:40: undefined reference to `pthread_mutexattr_settype'   
  4. /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:57: undefined reference to `pthread_mutexattr_destroy' ../common/pthread_func.o:  
  5.  In function `init_pthread_attr': /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:84: undefined reference to `pthread_attr_getstacksize'   
  6. /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:115: undefined reference to `pthread_attr_setstacksize' ../common/pthread_func.o:   
  7. In function `create_work_threads': /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:156: undefined reference to `pthread_create'   
  8. ../common/pthread_func.o:   
  9. In function `kill_work_threads': /home/FastDFS/FastDFS/tracker/../common/pthread_func.c:182: undefined reference to `pthread_kill'   
  10. collect2: ld 返回 1 make: *** [fdfs_monitor] 错误 1  


于是开始了网上搜索问题,得知,其实是不同的系统中pthread位置不一样,做法就是找到你的系统中所需要的libpthread.so文件位置,直接find就可以找到了;

步骤:

1、find / -name 'libpthread.a' 找到目录

2、find / -name 'libpthread.so'找到目录,

分别将以上目录,替换掉make.sh中的对应目录,修改完保存,重新执行./make.sh   ./make.sh install成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值