红联Linux门户
Linux帮助

ubuntu执行make.sh失败问题

发布时间:2016-04-19 10:32:18来源:linux网站作者:zhenweiyi

安装完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成功。


本文永久更新地址:http://www.linuxdiyf.com/linux/19891.html