NginX 0.9.6 令人沮丧的编译问题 Ubuntu/GCC 4.6.1

发布于 2024-10-26 23:45:26 字数 1226 浏览 3 评论 0原文

今天,我一直致力于设置额外的 VPS 克隆,并且在最新的 nginx 开发版本 (0.9.6) 中遇到了一个奇怪且令人沮丧的编译时错误。

我运行的是 Ubuntu 10.04.2 LTS x86_64,但是,我已将 GCC 升级到 4.6.1。 ./configure 运行时没有错误,但在运行 make -j4 时出现以下错误:

<块引用> gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \ -o objs/src/core/ngx_open_file_cache.o \ src/core/ngx_open_file_cache.c src/core/ngx_resolver.c:在函数中 'ngx_resolver_process_ptr': src/core/ngx_resolver.c:1425:43: 错误:变量“qclass”已设置但未设置 使用 [-Werror=未使用但设置变量] src/core/ngx_resolver.c:1425:36: 错误:变量“qtype”已设置但未设置 使用 [-Werror=未使用但设置变量] cc1:所有警告均被视为 错误

制作[1]:<强>* [objs/src/core/ngx_resolver.o] 错误 1 make[1]: * 等待未完成 jobs.... make[1]:离开目录 `/root/nginx-0.9.6' make: *** [构建] 错误2

(在pastebin上看得更清楚:http://pastebin.com/g0bNS2nY

我尝试添加-- with--cc-opt="-W" 到 ./configure 选项但没有结果。谁能解释一下这个节目的终结者吗?

非常非常感谢!

Today I've been working on setting up extra VPS clones and I've run into a strange and frustrating compile time error with the latest nginx development version (0.9.6).

I'm running Ubuntu 10.04.2 LTS x86_64, however, I've upgraded GCC to 4.6.1. ./configure runs without errors, but upon running make -j4 I'm presented with the following error:

gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_open_file_cache.o \
src/core/ngx_open_file_cache.c
src/core/ngx_resolver.c: In function
'ngx_resolver_process_ptr':
src/core/ngx_resolver.c:1425:43:
error: variable 'qclass' set but not
used [-Werror=unused-but-set-variable]
src/core/ngx_resolver.c:1425:36:
error: variable 'qtype' set but not
used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as
errors

make[1]: *
[objs/src/core/ngx_resolver.o] Error 1
make[1]: *
Waiting for unfinished
jobs.... make[1]: Leaving directory
`/root/nginx-0.9.6' make: *** [build]
Error 2

(Better seen at pastebin: http://pastebin.com/g0bNS2nY)

I've tried adding --with--cc-opt="-W" to the ./configure options but without result. Can anyone please shed some light on this show stopper?

Many, many thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一人独醉 2024-11-02 23:45:26

更好的方法是将以下内容传递给 ./configure

--with-cc-opt=-Wno-error

A nicer way to do this is to pass the following to ./configure

--with-cc-opt=-Wno-error
ま柒月 2024-11-02 23:45:26

编辑 Makefile,删除 -Werror。该选项意味着:如果出现问题,请立即退出编译器。或者手动运行出错的编译命令,同样不带 -Werror 标志:

gcc -c -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function \
 -Wunused-variable -Wunused-value -g  -Isrc/core -Isrc/event \
 -Isrc/event/modules -Isrc/os/unix -Iobjs \
 -o objs/src/core/ngx_open_file_cache.o src/core/ngx_open_file_cache.c

Edit the Makefile, remove -Werror. That options means: quit the compiler immediately if something doesn't seem right. Or run the compile command that went wrong manually, again without the -Werror flag:

gcc -c -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function \
 -Wunused-variable -Wunused-value -g  -Isrc/core -Isrc/event \
 -Isrc/event/modules -Isrc/os/unix -Iobjs \
 -o objs/src/core/ngx_open_file_cache.o src/core/ngx_open_file_cache.c
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文