Windows10 VS2019 编译nginx-http-flv

下载nginx源码

https://github.com/nginx/nginx

下载工具集

MinGW:https://osdn.net/projects/mingw/releases/

Perl :https://www.activestate.com/products/perl/downloads/

nasm:https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D 记得添加环境变量

sed:https://sourceforge.net/projects/gnuwin32/files/sed/4.2.1/ 记得添加环境变量

lib下三方库

nginx-http-flv-module:https://github.com/winshining/nginx-http-flv-module

openssl:http://distfiles.macports.org/openssl/ 选择1.0.版本的,听说1.1.版本会出问题

zlib:https://zh.osdn.net/projects/sfnet_libpng/downloads/zlib/1.2.11/zlib-1.2.11.tar.gz/

pcre:https://ftp.pcre.org/pub/pcre/

编译

1.新建文件夹nginx-flv,并解压nginx源码到nginx-flv下

2.在nginx-flv下新建文件夹build,进入build,在build下新建文件夹3rdlib和output

3.将nginx-http-flv-module,openssl,zlib,pcre解压缩到nginx-flv/build/3rdlib目录下

4.在nginx-flv目录下新建build.bat文件并输入以下脚本

 

auto/configure --with-cc=cl --builddir=build/output --prefix= \
--conf-path=conf/nginx.conf --pid-path=logs/nginx.pid \
--http-log-path=logs/access.log --error-log-path=logs/error.log \
--sbin-path=nginx-flv.exe --http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--http-scgi-temp-path=temp/scgi_temp \
--http-uwsgi-temp-path=temp/uwsgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=build/3rdlib/pcre-8.34 \       #不同版本请修改
--with-zlib=build/3rdlib/zlib-1.2.11 --with-openssl=build/3rdlib/openssl-1.0.1u \  #不同版本请修改
--with-select_module --with-http_ssl_module \
--add-module=build/3rdlib/nginx-http-flv-module-master    #本行很重要,如果只编译nginx可不要本行

5.打开mingw控制台

路径:mingw安装文件夹\msys\1.0\msys.bat 点击msys.bat即可
在这里插入图片描述
6.以管理员身份打开VS2019 命令提示工具进入nginx-flv目录
命令窗口路径
1.打开 开始菜单栏

2.找到Visual Studio 2019

3.选择x64 Native Tools Command Prompt for VS2019
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

进入nginx-flv目录(怎么切换文件夹,自己搜一下哈)
在这里插入图片描述
进行编译
在这里插入图片描述
编译成功后
在这里插入图片描述

文件修改

1.nginx-flv\auto\lib\openssl\mkaefile.msvc
有三处修改,如图所示
  • 1
  • 2

在这里插入图片描述
2.build\output\Makefile
在这里插入图片描述
将-W4 -WX 改为 -W3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值