当前位置: 首页 > 工具软件 > ngx-errors > 使用案例 >

make[1]: *** [objs/Makefile:1349: objs/addon/nginx-rtmp-module-master/ngx_rtmp_eval.o] Error 1

锺星腾
2023-12-01

目的

博主在树莓派4B上使用nginx+rtmp搭建音频直播流媒体服务器

安装步骤

参见博客:树莓派使用nginx+rtmp搭建音频直播流媒体服务器

编译时出错

编译时输入代码

make

出现以下错误

......

../nginx-rtmp-module-master/ngx_rtmp_eval.c: In function ‘ngx_rtmp_eval’:
../nginx-rtmp-module-master/ngx_rtmp_eval.c:160:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
                 switch (c) {
                 ^~~~~~
../nginx-rtmp-module-master/ngx_rtmp_eval.c:170:13: note: here
             case ESCAPE:
             ^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:1349: objs/addon/nginx-rtmp-module-master/ngx_rtmp_eval.o] Error 1
make[1]: Leaving directory '/home/pi/nginx-1.19.0'
make: *** [Makefile:8: build] Error 2

解决办法

禁用gcc中的“ fallthrough”,在配置时添加选项

--with-cc-opt="-Wimplicit-fallthrough=0"

所以配置命令应为:

./configure --with-http_ssl_module --with-debug --with-cc-opt="-Wimplicit-fallthrough=0" --add-module=../nginx-rtmp-module-master

配置完成后

make

sudo make install

即可完成安装。

 类似资料: