[英]Stop make from treating warnings as errors
I'm trying to make
the little proxy server tcproxy
: 我正在尝试
make
小代理服务器tcproxy
:
user@localhost:tcproxy $ make
cd src && make all
make[1]: Entering directory '/home/user/Downloads/tcproxy/src'
CC anet.o
In file included from /usr/include/sys/types.h:25:0,
from anet.c:33:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^
cc1: all warnings being treated as errors
Makefile:26: recipe for target 'anet.o' failed
make[1]: *** [anet.o] Error 1
make[1]: Leaving directory '/home/user/Downloads/tcproxy/src'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
Compilation is failing because all warnings are being treated as errors
编译失败,因为
all warnings are being treated as errors
It hasn't been updated in two years and it appears the warning is just from something being deprecated, but I'm hoping it should work nonetheless. 它已经有两年没有更新了,看来警告只是来自不赞成使用的东西,但是我希望它仍然可以工作。
I've Googled how to stop all warnings being treated as errors; 我已经搜索了如何停止将所有警告视为错误的警告; someone suggests using
-Wno-error
but that made no difference in my case. 有人建议使用
-Wno-error
但这对我的情况没有影响。
How can I force the compilation here? 如何在此处强制编译?
Note 注意
The Makefile
simply contains: Makefile
仅包含:
#
# tcproxy - Makefile
#
# Author: dccmx <dccmx@dccmx.com>
#
default: all
.DEFAULT:
cd src && $(MAKE) $@
In src/Makefile
there is a line defining : 在
src/Makefile
有一行定义:
CFLAGS_GEN = -Wall -Werror -g $(CFLAGS)
Remove the -Werror
and the warning you're getting should get ignored. 删除
-Werror
,将忽略您收到的警告。
These are compiler options, not make options, to be clear. 这些是编译器选项,不是make选项。
You need to find the options that you use when make invokes your compiler. 您需要找到在make调用编译器时使用的选项。 Look in your makefile for the option
-Werror
, and remove it from whatever variable it's contained in (probably CFLAGS
or some variation). 在makefile中查找选项
-Werror
,然后将其从包含的任何变量中删除(可能是CFLAGS
或某些变体)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.