Nginx使用make进行安装时将警告信息转为了错误信息,导致nginx安装失败

在执行Nginx的make安装过程中遇到cc1将所有警告视为错误的报错,导致安装失败。解决方案是在objs/Makefile中取消werror选项,通过vim编辑文件,保存修改后执行make及make install,从而成功安装Nginx。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错信息:cc1:所有的警告都被当作是错误 make[1]: *** [objs/Makefile:886:objs/src/

1.在执行完./configure解压后,在objs目录下找到makefile文件使用vim命令编辑该文件将werror去掉,导致该错误的问题主要是因为将警告转为报错导致。

js -I src/http -I src/http/modules \
        -o objs/src/http/modules/ngx_http_proxy_module.o \
        src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_proxy_module.c: 在函数‘ngx_http_proxy_init_headers’中:
src/http/modules/ngx_http_proxy_module.c:3528:22: 警告:cast between incompatible function types from ‘size_t (*)(ngx_http_script_engine_t *)’ {或称 ‘long unsigned int (*)(struct <匿名> *)’} to ‘void (*)(ngx_http_script_engine_t *)’ {或称 ‘void (*)(struct <匿名> *)’} [-Wcast-function-type]
         copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
                      ^
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
        -o objs/src/http/modules
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值