Nginx make报错处理

https://blog.csdn.net/zhengdong12345/article/details/130669711

 

 

make报错:fatal error:sys/sysctl.h:No such file or directory
执行make操作,报出fatal error:sys/sysctl.h:No such file or directory

 


问题处理
这个报错的主要原因是随着 glibc 2.32 的发布,Linux 系统删除了sys/sysctl.h。
Linux Kernel 5.5 最终消除了支持 sysctl 系统调用的代码,该代码已被弃用了大约十年,目前对任何架构的现代系统都没有影响。

查看系统版本:

 

可见Linux版本超过了5.5, 系统已经删除了 sys/sysctl.h
注释掉src/os/unix/ngx_linux_config.h中的 #include <sys/sysctl.h>

make 报错:error: this statement may fall through [-Werror=implicit-fallthrough=]
继续执行make操作,报出error: this statement may fall through [-Werror=implicit-fallthrough=]

 


问题处理
原因:表示打开gcc的所有警告 -Werror,它要求gcc将所有的警告当成错误进行处理
将 -Werror 直接去掉再重新make
其中:
-Wall 表示打开gcc的所有警告
-Werror,它要求gcc将所有的警告当成错误进行处理

打开:vim objs/Makefile 去掉-Werror即可

 

 

 

make报错:error: ‘struct crypt_data’ has no member named ‘current_salt’
继续执行make,报出error: ‘struct crypt_data’ has no member named ‘current_salt’

 


问题处理
原因:定义的crypt_data结构体中没有current_salt这个成员
处理:将有问题的那一行注释掉
进入到 src/os/unix/ngx_user.c中,注释掉第38行

 

 

posted @ 2024-04-20 10:04  牧之丨  阅读(220)  评论(0编辑  收藏  举报