yaoweibin / nginx_tcp_proxy_module

add the feature of tcp proxy with nginx, with health check and status monitor
http://yaoweibin.github.com/nginx_tcp_proxy_module
1.64k stars 366 forks source link

在nginx最新版的1.15.9版本上编译报错!找了很多资料都无法解决! #171

Open xkwy521 opened 5 years ago

xkwy521 commented 5 years ago

以前一直使用1.10.3,先在因程序需求,需要使用最新版,但始终编译报错! 请帮忙查找解决方法,谢谢! OpenSSL版本:1.0.2r

/root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c
/root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c: In function ‘ngx_tcp_ssl_merge_srv_conf’:
/root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:409:31: error: passing argument 3 of ‘ngx_ssl_session_cache’ makes pointer from integer without a cast [-Werror]
                               conf->shm_zone, conf->session_timeout)
                               ^
In file included from src/core/ngx_core.h:83:0,
                 from /root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:3:
src/event/ngx_event_openssl.h:194:11: note: expected ‘struct ngx_array_t *’ but argument is of type ‘ssize_t’
 ngx_int_t ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
           ^
/root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:409:31: error: passing argument 4 of ‘ngx_ssl_session_cache’ makes integer from pointer without a cast [-Werror]
                               conf->shm_zone, conf->session_timeout)
                               ^
In file included from src/core/ngx_core.h:83:0,
                 from /root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:3:
src/event/ngx_event_openssl.h:194:11: note: expected ‘ssize_t’ but argument is of type ‘struct ngx_shm_zone_t *’
 ngx_int_t ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
           ^
/root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:409:31: error: passing argument 5 of ‘ngx_ssl_session_cache’ makes pointer from integer without a cast [-Werror]
                               conf->shm_zone, conf->session_timeout)
                               ^
In file included from src/core/ngx_core.h:83:0,
                 from /root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:3:
src/event/ngx_event_openssl.h:194:11: note: expected ‘struct ngx_shm_zone_t *’ but argument is of type ‘time_t’
 ngx_int_t ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
           ^
/root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:409:31: error: too few arguments to function ‘ngx_ssl_session_cache’
                               conf->shm_zone, conf->session_timeout)
                               ^
In file included from src/core/ngx_core.h:83:0,
                 from /root/nginx/nginx_tcp_proxy_module/modules/ngx_tcp_ssl_module.c:3:
src/event/ngx_event_openssl.h:194:11: note: declared here
 ngx_int_t ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
           ^
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/modules/ngx_tcp_ssl_module.o] Error 1
make[1]: Leaving directory `/root/nginx/nginx-1.15.9'
make: *** [build] Error 2

rinoux commented 5 years ago

我也碰到了,你解决了吗?

rinoux commented 5 years ago

我弄好了,修改objs/Makefile文件,删掉-Werror参数

xkwy521 commented 5 years ago

我弄好了,修改的OBJ / Makefile文件,删掉-Werror参数

@rinoux 我是用的另外一个config -Werror这个参数是干啥的啊?删掉会不会有影响啊?

rinoux commented 5 years ago

我弄好了,修改的OBJ / Makefile文件,删掉-Werror参数

@rinoux 我是用的另外一个config -Werror这个参数是干啥的啊?删掉会不会有影响啊?

这个参数意思是“视警告为错误;出现任何警告即放弃编译.”

xkwy521 commented 5 years ago

我弄好了,修改的OBJ / Makefile文件,删掉-Werror参数

@rinoux 我是用的另外一个config -Werror这个参数是干啥的啊?删掉会不会有影响啊?

这个参数意思是“视警告为错误;出现任何警告即放弃编译.”

@rinoux 不敢这么弄,我怕用到某个功能时报错!

rinoux commented 5 years ago

我弄好了,修改的OBJ / Makefile文件,删掉-Werror参数

@rinoux 我是用的另外一个config -Werror这个参数是干啥的啊?删掉会不会有影响啊?

这个参数意思是“视警告为错误;出现任何警告即放弃编译.”

@rinoux 不敢这么弄,我怕用到某个功能时报错!

那你改代码吧,根据报错的行数找一下为啥要警告,我出现这个是因为case分支没有break

JCMZZ commented 3 years ago

我通过这里https://blog.csdn.net/JCM_ZZ/article/details/115699172解决掉了问题,我的Nginx版本是1.18.0