今天一问题小结:

多花了半天时间,得一教训.

案例:

在准备重新做squid-3.0.STABLE16squid-3.0.STABLE16配置 make 时出现以下错误使make中断

       g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/usr/local/squid/etc/squid.conf\" -I. -I../include -I. -I.                -I../include -I../include -I../lib/libTrie/include    -Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments                 -g -O2 -MT client_side.o -MD -MP -MF $depbase.Tpo -c -o client_side.o client_side.cc &&\
        mv -f $depbase.Tpo $depbase.Po
cc1plus: warnings being treated as errors
client_side.cc: In function 'int connKeepReadingIncompleteRequest(RefCount<ConnStateData>&)':
client_side.cc:2144: error: comparison between signed and unsigned integer expressions
make[3]: *** [client_side.o] Error 1
make[3]: Leaving directory `/root/squid-3.0.STABLE16/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/squid-3.0.STABLE16/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/squid-3.0.STABLE16/src'
make: *** [all-recursive] Error 1

经过多次检查确实编译环境没有问题,依赖也没有问题,问题就出在"cc1plus: warnings being treated as errors" 上gcc里如果加上 -Werror 来严格检查编译环境使用它能够使gcc产生告警也认为是错误.   faint. 就在这里 .当时没有仔细看错误输出,想当然地认为环境有问题,于是多折腾了半天时间.

解决这个问题也很简单,其实错误输出时都已有提示:

1, 进入 ./src目录 , 备份Makefile

2, 编辑Makefile 用空格替换所有的"-Werror " 后保存退出.

重新make && make install 一路顺畅