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

编译 Nginx 1.15.1 报错

Open jy00278439 opened this issue 6 years ago • 6 comments

In file included from /data/tools/fastdfs-nginx-module-1.20/src/common.c:26:0, from /data/tools/fastdfs-nginx-module-1.20/src/ngx_http_fastdfs_module.c:6: /usr/include/fastdfs/fdfs_define.h:15:27: fatal error: common_define.h: No such file or directory #include "common_define.h" ^ compilation terminated. make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/data/tools/nginx-1.15.0' make: *** [build] Error 2

fastdfs-nginx-module fatal error: common_define.h: No such file or directory

请问 v5.12 哪里下?值看到了 v5.11

jy00278439 avatar Jul 17 '18 12:07 jy00278439

用了 fastdfs-nginx-module 上一个版本 make 编译通过了

jy00278439 avatar Jul 17 '18 12:07 jy00278439

用了这个时间版本可以编译通过 Version 1.20 2017-05-26

jy00278439 avatar Jul 17 '18 12:07 jy00278439

解决办法

编辑 fastdfs-nginx-module-1.20/src/config 文件

vim fastdfs-nginx-module-1.20/src/config ngx_addon_name=ngx_http_fastdfs_module

if test -n "${ngx_module_link}"; then ngx_module_type=HTTP ngx_module_name=$ngx_addon_name ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/" ngx_module_libs="-lfastcommon -lfdfsclient" ngx_module_srcs="$ngx_addon_dir/ngx_http_fastdfs_module.c" ngx_module_deps= CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='2561024' -DFDFS_MOD_CONF_FILENAME='"/etc/fdfs/mod_fastdfs.conf"'" . auto/module else HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module" NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c" CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/" CORE_LIBS="$CORE_LIBS -lfastcommon -lfdfsclient" CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='2561024' -DFDFS_MOD_CONF_FILENAME='"/etc/fdfs/mod_fastdfs.conf"'" fi

改成以上内容貌似就可以通过

改变的文件内容

ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/" CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"

jy00278439 avatar Jul 17 '18 13:07 jy00278439

楼上可行

zzzgd avatar Aug 21 '18 08:08 zzzgd

@jy00278439 你的办法可行

BenjaminGao999 avatar Oct 04 '18 06:10 BenjaminGao999

优秀,我只配置了CORE_INCS 导致编译一直报错,上面ngx_module_incs也配置之后解决问题

Xia-Ao avatar Dec 04 '18 11:12 Xia-Ao