错误简要:
objs/ngx_modules.c:157:5: error: missing terminating " character [-Werror]
缺少终止符号 "
执行 configure 脚本时是成功的,但是执行 make 时出现如下错误提示:
[root@localhost nginx-1.18.0]# make
make -f objs/Makefile
make[1]: Entering directory `/root/mynginx/nginx-1.18.0'
cc -c -g -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/
event/modules -I src/os/unix -I objs \
......
/root/mynginx/ngx_http_mytest_module/ngx_http_mytest_module.c
cc -c -g -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/
event/modules -I src/os/unix -I objs \ -o objs/ngx_modules.o \
objs/ngx_modules.c
objs/ngx_modules.c:157:5: error: missing terminating " character [-Werror]
"ngx_http_header_filter_module",
^
objs/ngx_modules.c:157:5: error: missing terminating " character
objs/ngx_modules.c:158:1: error: missing terminating " character [-Werror]
"ngx_http_chunked_filter_module",
^
objs/ngx_modules.c:158:1: error: missing terminating " character
cc1: all warnings being treated as errors
make[1]: *** [objs/ngx_modules.o] Error 1
make[1]: Leaving directory `/root/mynginx/nginx-1.18.0'
make: *** [build] Error 2
[root@localhost nginx-1.18.0]#
解决办法:
经排查,居然将模块内的 config 和 模块代码文件的格式转化成 unix 格式,再重新执行 configure,之后 make 就可以了。
原因:
估计windows的换行在执行 configure之后,解析会出现问题,导致生成的代码文件格式出错。最后 make 失败。
本文记录了一次Nginx编译过程中遇到的make错误,详细描述了错误信息及可能的原因,最后给出了将源文件转换为Unix格式并重新配置以解决问题的方法。

1170

被折叠的 条评论
为什么被折叠?



