happyfish100 / fastdfs-nginx-module

FastDFS nginx module
GNU Lesser General Public License v3.0
434 stars 260 forks source link

Comile error with fastdfs-nginx-module-1.20 #86

Closed lystormenvoy closed 3 years ago

lystormenvoy commented 3 years ago

Message:

In file included from ../fastdfs-nginx-module-1.20/src/ngx_http_fastdfs_module.c:6:0:
../fastdfs-nginx-module-1.20/src/common.c: In function ‘fdfs_mod_init’:
../fastdfs-nginx-module-1.20/src/common.c:349:4: error: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘FDFSStorePathInfo’ [-Werror=format=]
    len += snprintf(buff + len, sizeof(buff) - len, \
    ^
../fastdfs-nginx-module-1.20/src/common.c:349:4: error: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘FDFSStorePathInfo’ [-Werror=format=]
../fastdfs-nginx-module-1.20/src/common.c:387:3: error: ‘g_storage_id_count’ undeclared (first use in this function)
   g_storage_id_count, flv_support, flv_extension);
   ^
../fastdfs-nginx-module-1.20/src/common.c:387:3: note: each undeclared identifier is reported only once for each function it appears in
../fastdfs-nginx-module-1.20/src/common.c:398:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘FDFSStorePathInfo’ [-Werror=format=]
     len += snprintf(buff + len, sizeof(buff) - len, \
     ^
../fastdfs-nginx-module-1.20/src/common.c:398:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘FDFSStorePathInfo’ [-Werror=format=]
../fastdfs-nginx-module-1.20/src/common.c: In function ‘fdfs_http_request_handler’:
../fastdfs-nginx-module-1.20/src/common.c:1085:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘FDFSStorePathInfo’ [-Werror=format=]
     snprintf(full_filename, \
     ^
../fastdfs-nginx-module-1.20/src/common.c:1085:5: error: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘FDFSStorePathInfo’ [-Werror=format=]
../fastdfs-nginx-module-1.20/src/common.c:1430:3: error: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘FDFSStorePathInfo’ [-Werror=format=]
   full_filename_len = snprintf(full_filename, \
   ^
../fastdfs-nginx-module-1.20/src/common.c:1430:3: error: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘FDFSStorePathInfo’ [-Werror=format=]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Packages: libfastcommon-1.0.50 nginx-1.20.0 fastdfs-6.07

Configure:

./configure \
--prefix=/usr/local/nginx \
--sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--pid-path=/usr/local/nginx/nginx.pid \
--error-log-path=/usr/local/nginx/logs/error.log \
--http-client-body-temp-path=/usr/local/nginx/client_temp \
--http-proxy-temp-path=/usr/local/nginx/proxy_temp \
--http-fastcgi-temp-path=/usr/local/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp \
--http-scgi-temp-path=/usr/local/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--add-module=../fastdfs-nginx-module-1.20/src \
--add-module=../pingos-1.0/modules/nginx-client-module \
--add-module=../pingos-1.0/modules/nginx-multiport-module \
--add-module=../pingos-1.0/modules/nginx-toolkit-module \
--add-module=../pingos-1.0/modules/nginx-rtmp-module \
--add-module=../pingos-1.0/modules/nginx-ts-module \
--with-compat \
--with-file-aio \
--with-threads \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-mail \
--with-mail_ssl_module \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-openssl=../openssl-1.1.1k \
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' \
--with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' \
--with-debug

pingos is a nginx module base on nginx-rtmp-module , can be find in github.

And I compile in docker.