implicit declaration of function ‘ngx_http_upstream_header_variable’
rainyroads opened this issue · 4 comments
Trying to build Nginx 1.11.10 with mod_zip on Debian Jessie fails with the following error,
/usr/local/src/nginx/extensions/mod_zip/ngx_http_zip_file.c: In function ‘ngx_http_zip_generate_pieces’:
/usr/local/src/nginx/extensions/mod_zip/ngx_http_zip_file.c:253:5: error: implicit declaration of function ‘ngx_http_upstream_header_variable’ [-Werror=implicit-function-declaration]
if(ngx_http_upstream_header_variable(r, vv, (uintptr_t)(&ngx_http_zip_header_name_separator)) == NGX_OK && !vv->not_found) {
^
/usr/local/src/nginx/extensions/mod_zip/ngx_http_zip_module.c: In function ‘ngx_http_zip_main_request_header_filter’:
/usr/local/src/nginx/extensions/mod_zip/ngx_http_zip_module.c:197:9: error: implicit declaration of function ‘ngx_http_upstream_header_variable’ [-Werror=implicit-function-declaration]
variable_header_status = ngx_http_upstream_header_variable(r, vv,
cc1: all warnings being treated as errors
objs/Makefile:1535: recipe for target 'objs/addon/mod_zip/ngx_http_zip_module.o' failed
make[1]: *** [objs/addon/mod_zip/ngx_http_zip_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
objs/Makefile:1549: recipe for target 'objs/addon/mod_zip/ngx_http_zip_file.o' failed
make[1]: *** [objs/addon/mod_zip/ngx_http_zip_file.o] Error 1
make[1]: Leaving directory '/usr/local/src/nginx/source/nginx-1.11.10'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
This regression was introduced in: http://hg.nginx.org/nginx/rev/d2b2ff157da5
I'm getting a related error building nginx 1.11.10 under MacPorts:
-L/opt/local/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -lexpat -L/opt/local/lib -lluajit-5.1 -lm -ldl -pagezero_size 10000 -image_base 100000000 -lpcre -lssl -lcrypto -lz -lxml2 -lxslt -lexslt Undefined symbols for architecture x86_64: "_ngx_http_upstream_header_variable", referenced from: _ngx_http_zip_header_filter in ngx_http_zip_module.o ld: symbol(s) not found for architecture x86_64
@FujiMakoto a quickfix: just move defn ngx_http_upstream_header_variable from the beginning of ngx_http_upstream.c to the ngx_http_upstream.h, change it to non-static and change func ngx_http_upstream_header_variable in the ngx_http_upstream.c to non-static
Fixed in a7f9f8b