fastdfs-nginx-module icon indicating copy to clipboard operation
fastdfs-nginx-module copied to clipboard

Nginx1.16编译fastdfs-nginx-module/src/common.c报错

Open voto-laughing opened this issue 4 years ago • 12 comments

Nginx1.16、fastdfs-nginx-module版本1.20,编译fastdfs-nginx-module/src/common.c报错: /common.c:387:3: 错误:‘g_storage_id_count’未声明(在此函数内第一次使用) g_storage_id_count, flv_support, flv_extension);

voto-laughing avatar Oct 21 '19 06:10 voto-laughing

刚刚遇到同样的问题,也是g_storage_id_count未声明,g_storage_id_count, flv_support, flv_extension);

dirklei avatar Oct 21 '19 08:10 dirklei

需要安装最新版本的libfastcommon 和FastDFS。 先编译和安装以下版本即可: libfastcommon V1.41 FastDFS V6.0

happyfish100 avatar Oct 21 '19 08:10 happyfish100

确实用的是最新版本,libfastcommon 1.0.41和fastDFS6.0,还是不行 error: ‘g_storage_id_count’ undeclared (first use in this function); did you mean ‘g_storage_ids_by_ip’? g_storage_id_count, flv_support, flv_extension); ^~~~~~~~~~~~~~~~~~ g_storage_ids_by_ip

dirklei avatar Oct 21 '19 11:10 dirklei

fastdfs-nginx-module要用最新版本。可以直接使用master版本或者 V1.21 的tag。

$ cat HISTORY Version 1.21 2019-10-16

  • you must upgrade your FastDFS to v6.00 or higher version

happyfish100 avatar Oct 21 '19 11:10 happyfish100

使用fdfs6.0 ,fdfs-nginx-1.21,common-1.0.41,安装成功,但是nginx启动报错 ERROR - file: ../common/fdfs_http_shared.c, line: 153, param "http.mime_types_filename" not exist or is empty

dirklei avatar Oct 21 '19 12:10 dirklei

mime.types 和 http.conf 这两个配置文件在 fastdfs源码的conf目录下,你复制到 /etc/fdfs/下即可。

happyfish100 avatar Oct 21 '19 12:10 happyfish100

这两个文件在/etc/fdfs下是有的,尝试在tracker.conf和storage.conf文件里配置http.mime_types_filename参数也不行,还是相同的错误信息,我的nginx是openresty1.5.7版本,不知道有影响不

dirklei avatar Oct 21 '19 12:10 dirklei

你看下 fastdfs-nginx-module 目录下的 INSTALL 文件,fastdfs-nginx-module 默认的 配置文件为:/etc/fdfs/mod_fastdfs.conf。

happyfish100 avatar Oct 21 '19 13:10 happyfish100

fastdfsV6.0没有声明这个变量,使用V5.12就可以正常编译了

voto-laughing avatar Oct 24 '19 03:10 voto-laughing

需要安装最新版本的libfastcommon 和FastDFS。 先编译和安装以下版本即可: libfastcommon V1.41 FastDFS V6.0

是在添加nginx模块成功后,其他的安装都没有问题,fastdfs可以命令上传文件,nginx在make时报错了

voto-laughing avatar Oct 24 '19 03:10 voto-laughing

ld: library not found for -lfdfsclient clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [objs/nginx] Error 1 make: *** [build] Error 2

Shj451148969 avatar Oct 29 '19 11:10 Shj451148969

使用了最新版后出现了这个问题

Shj451148969 avatar Oct 29 '19 11:10 Shj451148969