Windows compiler Nginx+nginx_rtmp_modue (vs2013)

Source: Internet
Author: User

Read the official method of compiling the version of Windows http://nginx.org/en/docs/howto_build_on_win32.html

My environment Windows 7 Ultimate 64,visual Studio 2013

Nginx_rtmp_modue in Nginx 1.7 is unable to compile (Linux is not possible), so get 1.6 version to compile:

HG Clone Http://hg.nginx.org/nginx Nginx-1.6-u release-1.6.1 (must be run under command line)

Several other download resources

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

Problems and Solutions

1, adding Nginx_rtmp_module compilation options

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, the auto/configure command needs to be executed under the Msys command line;

3, Nmake-f Objs/makefile needs to be executed at the VS command line, in C:\Program Files (x86) \common7\tools\shortcuts can be seen:

If you need to compile 64-bit then choose x64 Command-line tool;

3 when executing nmake-f objs/makefile times wrong

From the output log, is compiled OpenSSL caused, from the error message to see: "Error C2220" warning is considered an error, here only see warning C4996 a warning, so the problem must be here,

Then add a compile option to OpenSSL to ignore this warning:--with-openssl-opt=-wd4996;

Change the Configure command to:

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

To run after modification;

(The following methods are simpler and more efficient)

You can also directly modify the Objs/makefile file under the Nginx directory to find this line:

$ (make)-F auto/lib/openssl/makefile.msvcopenssl= ". /lib/openssl-0.9.8r "

Then modify to:

$ (make)-F auto/lib/openssl/makefile.msvcopenssl= ". /lib/openssl-0.9.8r "openssl_opt="-wd4996 "

After modification, execute nmake-f objs/makefile, done!

Windows compiler Nginx+nginx_rtmp_modue (vs2013)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.