ADD-SP / ngx_waf

Handy, High performance, ModSecurity compatible Nginx firewall module & 方便、高性能、兼容 ModSecurity 的 Nginx 防火墙模块
https://add-sp.github.io/ngx_waf-docs/
BSD 3-Clause "New" or "Revised" License
1.49k stars 187 forks source link

current 10.1.2编译报错 #111

Closed desslee closed 2 years ago

desslee commented 2 years ago
/include -I /usr/local/src/nginx-1.20.1/libsodium/include \
        -o objs/addon/src/ngx_http_waf_module_config.o \
        /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c
In file included from /usr/local/src/ngx_waf/inc/ngx_http_waf_module_type.h:23:0,
                 from /usr/local/src/ngx_waf/inc/ngx_http_waf_module_config.h:22,
                 from /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:1:
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c: In function ‘ngx_http_waf_captcha_conf’:
/usr/local/src/ngx_waf/inc/ngx_http_waf_module_macro.h:359:33: error: the comparison will always evaluate as ‘false’ for the address of ‘sitekey’ will never be NULL [-Werror=address]
 #define ngx_is_null_str(s) ((s) == NULL || (s)->data == NULL || (s)->len == 0 || ((s)->data[0] == '\0' && (s)->len == 1))
                                 ^
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:833:13: note: in expansion of macro ‘ngx_is_null_str’
         if (ngx_is_null_str(&sitekey)) {
             ^
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_waf_module_config.o] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-1.20.1'
make: *** [build] Error 2
make -f objs/Makefile
make[1]: Entering directory `/usr/local/src/nginx-1.20.1'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -std=gnu99 -fstack-protector-strong -Wno-sign-compare  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I /usr/local/src/ngx_waf/inc -I /usr/local/src/ngx_waf/lib -I /usr/local/modsecurity/include -I /usr/local/src/ngx_waf/lib/uthash/include -I /usr/local/src/nginx-1.20.1/libsodium/include \
        -o objs/addon/src/ngx_http_waf_module_config.o \
        /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c
In file included from /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:1:0:
/usr/local/src/ngx_waf/inc/ngx_http_waf_module_config.h:19:21: fatal error: utarray.h: No such file or directory
 #include <utarray.h>
                     ^
compilation terminated.
make[1]: *** [objs/addon/src/ngx_http_waf_module_config.o] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-1.20.1'
make: *** [build] Error 2

可以提供的信息

Mr-BeanSir commented 2 years ago

你好,我遇到了同样问题,请问你是如何解决的?