在编译nginx的mod_wsgi模块时, 会碰到一个错误.
cc1: warnings being treated as errors
../mod_wsgi/src/ngx_http_wsgi_module.c: In function ‘ngx_http_wsgi_handler’:
../mod_wsgi/src/ngx_http_wsgi_module.c:624: warning: implicit declaration of function ‘ngx_http_discard_body’
make[1]: *** [objs/addon/src/ngx_http_wsgi_module.o] Error 1
原因是Nginx在升级的时候, 修改了一个接口的函数名.
修改:
ngx_http_wsgi_module.c
624行:
- rc = ngx_http_discard_body(r);
+rc = ngx_http_discard_request_body(r);然后可以了.

本文介绍了一种常见的Nginx mod_wsgi模块编译时遇到的错误:cc1警告被视为错误,特别是在ngx_http_wsgi_module.c文件中关于函数ngx_http_discard_body的隐式声明问题。文章提供了具体的解决方案,即通过更改函数名为ngx_http_discard_request_body来修复此问题。
619





