Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xkwy521 opened this issue Mar 12, 2019 · 7 comments

Comments

@xkwy521
Copy link

xkwy521 commented Mar 12, 2019

以前一直使用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
Copy link

rinoux commented Mar 20, 2019

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

@rinoux
Copy link

rinoux commented Mar 21, 2019

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

@xkwy521
Copy link
Author

xkwy521 commented Mar 21, 2019

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

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

@rinoux
Copy link

rinoux commented Mar 21, 2019

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

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

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

@xkwy521
Copy link
Author

xkwy521 commented Mar 21, 2019

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

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

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

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

@rinoux
Copy link

rinoux commented Mar 25, 2019

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

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

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

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

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

@JCMZZ
Copy link

JCMZZ commented Apr 14, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants