NginX 0.9.6 令人沮丧的编译问题 Ubuntu/GCC 4.6.1
今天,我一直致力于设置额外的 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
errorsmake[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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更好的方法是将以下内容传递给 ./configure
A nicer way to do this is to pass the following to ./configure
编辑
Makefile
,删除-Werror
。该选项意味着:如果出现问题,请立即退出编译器。或者手动运行出错的编译命令,同样不带-Werror
标志: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: