在安装完nginx后执行make报错如下:
原因:将警告当成错误处理
解决错误1:进入到nginx-1.6.3目录下(解压的目录)
找到当前目录下找到objs文件夹,并进入,打开文件Makefile,找到有一下内容的这行:
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g
-Werror: gcc将所有的警告当成错误进行处理把这行内容中的 “-Werror”去掉
解决错误2:找到目录/usr/local/java/nginx-1.9.0/src/os/unix/ngx_user.c 文件。
将这行代码注释掉即可。cd.current_salt[0] = ~salt[0];
更改前:
#ifdef __GLIBC__
/* work around the glibc bug */
cd.current_salt[0] = ~salt[0];
#endif
更改后:
#ifdef __GLIBC__
/* work around the glibc bug */
/* cd.current_salt[0] = ~salt[0]; */
#endif
注:
借鉴链接:
1.https://blog.csdn.net/caoshiminYQS/article/details/93785979
2.https://www.91mszl.com/zhangwuji/article/details/1287
原文:https://www.cnblogs.com/zcl1116/p/14192817.html