Ubuntu 系统下搭建 SRS 流媒体服务器(以及报错处理)

然后安装 Git:
执行 apt install git

正式安装

  1. 执行 git clone https://github.com/ossrs/srs [该过程很漫长] 《如果下载不下来可以换个地址https://gitee.com/chenzhu005774/srs 下载后上传上去也行的》
  2. 执行 cd srs/trunk
  3. 执行 ./configure && make
  4. 启动服务器则执行 ./objs/srs -c conf/srs.conf

遇到的问题

若在上节步骤 3 中的时候报下面的错误信息

 

patching file Makefile
cc -I. -DHTTP_PARSER_STRICT=1  -Wall -Wextra -Werror -O0 -g  -c http_parser.c
http_parser.c: In function ‘http_parser_parse_url’:
http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
         found_at = 1;
         ~~~~~~~~~^~~
http_parser.c:2096:7: note: here
       case s_req_server:
       ^~~~
cc1: all warnings being treated as errors
Makefile:40: recipe for target 'http_parser.o' failed
make: *** [http_parser.o] Error 1
build http-parser-2.1 failed, ret=2

该错误将在 SRS3 版本后解决,2 版本则需要开发者自行处理,处理流程在下。

步骤:

  • 执行 cd .. 回到 trunk 目录

  • 执行 cd 3rdparty 进入三方框架目录

  • 执行 mkdir tempcd temp

  • 执行 unzip ../http-parser-2.1.zip

    Ubuntu 系统下搭建 SRS 流媒体服务器(以及报错处理)_第1张图片

    image

     

  • 执行 grep -n "FALLT" ./http-parser-2.1/http_parser.c

    image

     

  • 执行 sed -e s/FALLTROUGH/FALLTHROUGH/ -i ./http-parser-2.1/http_parser.c

  • 执行 grep -n "FALLT" ./http-parser-2.1/http_parser.c

    image

     

  • 执行 mv ../http-parser-2.1.zip ../http-parser-2.1-orig.zip

  • 执行 zip ../http-parser-2.1.zip http-parser-2.1/*

    Ubuntu 系统下搭建 SRS 流媒体服务器(以及报错处理)_第2张图片

    image

     

  • 执行 cd ../.. 回到 trunk 文件夹,此时一定是解决成功的 

  • 执行 ./configure && make

    Ubuntu 系统下搭建 SRS 流媒体服务器(以及报错处理)_第3张图片



作者:valentizx
链接:https://www.jianshu.com/p/7a2c930138f6
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

你可能感兴趣的:(C/C++)