前言
最近升级Nginx 1.24.0,编译第三方module出错:
/usr/src/nginx_modules/ngx_json_post_module/src/ngx_json_post_module.c
In file included from src/event/ngx_event.h:526,
from src/http/ngx_http_upstream.h:14,
from src/http/ngx_http.h:34,
from /usr/src/nginx_modules/ngx_json_post_module/src/ngx_json_post_module.c:11:
src/event/ngx_event_udp.h:38:27: error: field ‘pkt6’ has incomplete type
38 | struct in6_pktinfo pkt6;
| ^~~~
原因
从这个可以看出,
field ‘pkt6’ has incomplete type
是定义不匹配,查了一下资料:
https://trac.nginx.org/nginx/ticket/2312
同时,看了一下第三方module的源码,发现第三方module源码,不是以nginx规则开头的:
The following two #include statements must appear at the beginning of every nginx file:
#include <ngx_config.h>
#include <ngx_core.h>
Development guide
解决
所以修改文件include头顺序,文章来源:https://www.toymoban.com/news/detail-780781.html
#include <ngx_config.h>
#include <ngx_core.h>
....
搞定文章来源地址https://www.toymoban.com/news/detail-780781.html
到了这里,关于Nginx modules build fail:field ‘pkt6’ has incomplete type的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!