安装fastDfs出现的错误../common/fdfs_global.h:17:26: fatal error: sf/sf_global.h: No such file or directory

背景

在centOs7安装部署单机版fastDfs libfastcommon
都是在github上下载zip文件传输到虚拟机上进行解压编译
在这里插入图片描述

重点
在libfastcommon目录下 执行./make.sh && ./make.sh install 编译成功,在usr/lib64下生成了对应的libfastcommon.so
但是在fastDfs目录下执行./make.sh && ./make.sh install时报错

[root@localhost fastdfs-master]# ./make.sh
gcc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O1 -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c  -I../common -I/usr/local/include
In file included from ../common/fdfs_global.c:21:0:
../common/fdfs_global.h:17:26: fatal error: sf/sf_global.h: No such file or directory
 #include "sf/sf_global.h"
                          ^
compilation terminated.
make: *** [../common/fdfs_global.o] Error 1
gcc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O1 -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c  -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon
In file included from ../common/fdfs_global.c:21:0:
../common/fdfs_global.h:17:26: fatal error: sf/sf_global.h: No such file or directory
 #include "sf/sf_global.h"
                          ^
compilation terminated.
make: *** [../common/fdfs_global.o] Error 1
gcc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O1 -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c  -I../common -I../tracker -I/usr/include/fastcommon
In file included from ../common/fdfs_global.c:21:0:
../common/fdfs_global.h:17:26: fatal error: sf/sf_global.h: No such file or directory
 #include "sf/sf_global.h"
                          ^
compilation terminated.
make: *** [../common/fdfs_global.o] Error 1

在这里插入图片描述

解决

先执行以下命令

find /usr -name "fastcommon*"
find /usr -name "libfastcommon*"
rm -rf /usr/local/include/fastcommon*
rm -rf /usr/include/fastcommon*
rm /usr/local/lib/libfastcommon.so /usr/lib/libfastcommon.so /usr/lib64/libfastcommon.so

重新安装 libfastcommon-1.0.43.gz、fastdfs-6.06.gz 即可