阅读官方编译windows版本的方法 http://nginx.org/en/docs/howto_build_on_win32.html

我的环境 Windows 7 Ultimate 64,Visual Studio 2013

nginx_rtmp_modue 在nginx 1.7是无法编译(linux就不行),所以获取1.6的版本进行编译:

hg clone http://hg.nginx.org/nginx nginx-1.6 -u release-1.6.1 (必须在命令行下运行)

其他几个下载资源

pre http://ncu.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.zip

zlib  http://cznic.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz

openssl http://www.openssl.org/source/openssl-1.0.1e.tar.gz

nginx_rtmp_modue https://github.com/arut/nginx-rtmp-module

问题与解决

1,添加nginx_rtmp_module编译选项

auto/configure --with-cc=cl --builddir=objs --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.exe --http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.35 \
--with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1e \
--with-select_module --with-http_ssl_module --with-ipv6 \
--add-module=../nginx-module/nginx-rtmp-module

2, auto/configure 命令需要在MSYS命令行下执行;

3, nmake -f objs/Makefile需要在vs 命令行执行,在c:\Program Files (x86)\Common7\Tools\Shortcuts 可以看到:

如果你需要编译64位的则选择x64的命令行工具;

3,当执行nmake -f objs/Makefile 时报错

从输出日志看,是编译openssl造成的,从错误信息看到: error C2220 “警告被视为错误”,这里只看到了warning C4996一个警告,所以问题必然出在这了,

那就给openssl加上编译选项忽略掉这个警告:--with-openssl-opt=-wd4996;

将configure命令改成:

auto/configure --with-cc=cl --builddir=objs --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.exe --http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.35 \
--with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1e \
--with-select_module --with-http_ssl_module --with-ipv6 \
--with-openssl-opt=-wd4996 \
--add-module=../nginx-module/nginx-rtmp-module

修改后运行;

(以下方法更简单高效)

也可以直接修改nginx目录下的的objs/Makefile文件,找到这一行:

$(MAKE) -f auto/lib/openssl/makefile.msvcOPENSSL="../lib/openssl-0.9.8r"

然后修改为:

$(MAKE) -f auto/lib/openssl/makefile.msvcOPENSSL="../lib/openssl-0.9.8r" OPENSSL_OPT="-wd4996"

修改完后执行nmake -f objs/Makefile, done!

windows下编译nginx+nginx_rtmp_modue(vs2013)的更多相关文章

  1. Nginx (一)Windows下编译Nginx源码以及安装 nginx for windows方法步骤

    转载自: http://apps.hi.baidu.com/share/detail/11192699#content Nginx介绍: Nginx ("engine x")是一个 ...

  2. windows下编译调试nginx

    typora-copy-images-to: image windows下编译调试nginx linux使用gdb跟踪代码效率不高,在通过跟踪代码进行源码分析,与定位复杂逻辑问题时,如果有一个简单易用 ...

  3. Windows下编译OpenSSL(使用VS2013)

    简述 OpenSSL是一个开源的第三方库,它实现了SSL(Secure SocketLayer)和TLS(Transport Layer Security)协议,被广泛企业应用所采用.对于一般的开发人 ...

  4. Windows下搭建Nginx图片服务器

    在项目最开始,上传图片的时候,服务器先保存原图再使用ImageMagick生成上传图片缩略图,这种方法有很多缺点,例如生成的缩略图的大小是固定的,不能动态请求指定大小的缩略图. 虽然有非常多的图片云存 ...

  5. 在Windows下编译WebRTC

    前言 这篇文章的目的在于为你节省生命中宝贵的10小时(甚至更多),或者浪费你10分钟.作为Google更新频繁的大型跨平台基础库,WebRTC的编译一直被人称为噩梦.如果恰巧你偏要在Windows下编 ...

  6. windows下编译配置libnet-1.2-rc3

    1.下载winpcap(一个底层驱动,可以嗅探.过滤网卡数据包,发包).exe安装包,傻瓜一步式安装 2.下载WpdPack_4_1_2,这个是winpcap的开发者包,解压之后只需要配置相关路径. ...

  7. [转] Windows下编译OpenSSL

    简述 OpenSSL是一个开源的第三方库,它实现了SSL(Secure SocketLayer)和TLS(Transport Layer Security)协议,被广泛企业应用所采用.对于一般的开发人 ...

  8. windows 下使用Nginx替代apache作为服务器

    说实话, 在windows下使用Nginx 着实有点不太方便, 但因项目需求, 又不想换系统(虽然可以搞个虚拟机玩), 只能用Nginx了 好了, 不多说了. 开始... 首先我用的是xampp包(A ...

  9. windows下安装nginx

    说起开发,自己感到非常惭愧,由于公司让我给<绿电侠>项目写整体架构解决方案,才开始接触nginx这个东东,突然觉得它是一把非常好的利器. 本文主要记录在windows下安装nginx,另参 ...

随机推荐

  1. HDU 5875 Function (线段树+gcd / 单调栈)

    题意:给你一串数a再给你一些区间(lef,rig),求出a[lef]%a[lef+1]...%a[rig] 题解:我们可以发现数字a对数字b取模时:如果a<b,则等于原数,否则a会变小至少一半. ...

  2. 解决方案:System.InvalidOperationException: 此实现不是 Windows 平台 FIPS 验证的加密算法的一部分。

    System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS valid ...

  3. gzip压缩解压缩

    压缩/解压缩压缩/解压缩之后的文件名称 必须是gz 解压缩

  4. LeetCode OJ:Gas Station(加油站问题)

    There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You ...

  5. 20165202 week10课下补做

    相关知识点总结 在数据结构和算法中,排序是很重要的操作,要让一个类可以进行排序,有两种方法: 有类的源代码,针对某一成员变量排序,让类实现Comparable接口,调用Collection.sort( ...

  6. windows7 下安装python3.6开发环境

    所有的软件都放在百度云盘里: 链接: https://pan.baidu.com/s/1rux8sDK9thhbZ1qjwQg6kA 密码: iq4c 1. 安装python3.6.5 安装的时候要把 ...

  7. 微信小程序的一些数据调用方式

    1.模板数据的调用 一张图了解一下在wxml页调用预先定义好的模板: 可以看到上面调用了两个模板,数据调用却是不同的,obj是一个对象,对象内包含多个键值对形式的数据: tabbar是一个一维数组,每 ...

  8. UIview的一些属性

    一.UIView(视图\控件)1.在屏幕上能看得见.摸得着的东西,都是UIView对象2.任何UIView都可以充当其他UIView的容器3.关于UIView的一些疑问1> 谁来管理UIView ...

  9. 安卓开发 报错 错误:This version of android studio is incompatible with the gradle version used. 的解决

    本文的解决方法主要参考以下文章: https://blog.csdn.net/sinat_15417921/article/details/51907728 Android 开发总是会遇到各种不知道怎 ...

  10. 博客迁移至“零一积流|it-refer.com”

    虽然在博客园写了没几篇文章,考虑到个人发展,自己还是建立一个独立的站点:零一积流. 以后直接在自己网站上写东西了,此处只用做文章收藏.