关于fastDFS安装过程出现的问题
解压fastDFS安装包,执行./make sh命令后,发现编译出错
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -o fdfs_trackerd fdfs_trackerd.c …/common/fdfs_global.o tracker_proto.o tracker_mem.o tracker_service.o tracker_status.o tracker_global.o tracker_func.o fdfs_shared_func.o tracker_nio.o tracker_relationship.o tracker_dump.o …/common/linux_stack_trace.o -L/usr/local/lib -lpthread -ldl -rdynamic -lfastcommon -I…/common -I/usr/include/fastcommon
/usr/bin/ld: cannot find -lfastcommon
collect2: ld 返回 1
make: *** [fdfs_trackerd] 错误 1
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -o fdfs_storaged fdfs_storaged.c …/common/fdfs_global.o …/tracker/fdfs_shared_func.o …/tracker/tracker_proto.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 trunk_mgr/trunk_mem.o trunk_mgr/trunk_shared.o trunk_mgr/trunk_sync.o trunk_mgr/trunk_client.o trunk_mgr/trunk_free_block_checker.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 -lpthread -ldl -rdynamic -lfastcommon -I. -Itrunk_mgr -I…/common -I…/tracker -I…/client -Ifdht_client -I/usr/include/fastcommon
/usr/bin/ld: cannot find -lfastcommon
collect2: ld 返回 1
make: *** [fdfs_storaged] 错误 1
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -o fdfs_monitor fdfs_monitor.c …/common/fdfs_global.o …/common/fdfs_http_shared.o …/common/mime_file_parser.o …/tracker/tracker_proto.o …/tracker/fdfs_shared_func.o …/storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -lpthread -ldl -rdynamic -lfastcommon -I…/common -I…/tracker -I/usr/include/fastcommon
/usr/bin/ld: cannot find -lfastcommon
collect2: ld 返回 1
make: *** [fdfs_monitor] 错误 1
后来发现的一种解决方式:
创建软链接
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
或者有可能是fastDFS的依赖安装不全等问题,如:
安装libevent依赖: yum install libevent-devel.x86_64