总体来说,各个步骤以及版本参考官方文档http://nginx.org/en/docs/howto_build_on_win32.html一点没错,有些细节没说清楚。

To build nginx:

  • Start MSYS bash.
  • Check out nginx sources from the hg.nginx.org repository. For example: 必须使用源代码仓库中的版本,tar.gz发行包中的虽然是源码,但是不包含windows平台库,否则会提示缺少windows相关头文件
    hg clone http://hg.nginx.org/nginx
    
  • Create a build and lib directories, and unpack zlib, PCRE and OpenSSL libraries sources into lib directory:
    mkdir objs
    mkdir objs/lib
    cd objs/lib
    tar -xzf ../../pcre-8.41.tar.gz
    tar -xzf ../../zlib-1.2.11.tar.gz
    tar -xzf ../../openssl-1.0.2n.tar.gz
  • Run configure script:  windows下中文简体编译的时候,先将ssl/bad_dtls_test.c编码格式改为unicode或者gb2312,否则默认警告视为错误会编译出错
    auto/configure \
    --with-cc=cl \
    --with-debug \
    --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 \
    --http-scgi-temp-path=temp/scgi_temp \
    --http-uwsgi-temp-path=temp/uwsgi_temp \
    --with-cc-opt=-DFD_SETSIZE=1024 \
    --with-pcre=objs/lib/pcre-8.41 \
    --with-zlib=objs/lib/zlib-1.2.11 \
    --with-openssl=objs/lib/openssl-1.0.2n \
    --with-openssl-opt=no-asm \
    --with-select_module \
    --with-http_ssl_module
  • Run make: 在vs命令行下执行,而不是msys窗口
    nmake
    

nginx.exe生成后,双击启动的时候立刻就消失了。从cmd打开执行,可以知道是少了error/conf/temp等目录所致,自己看提示应该可以解决。

参考:

http://nginx.org/en/docs/howto_build_on_win32.html

https://blog.csdn.net/i348018533/article/details/51701865

https://blog.csdn.net/hard_cold/article/details/13989337

http://www.xuebuyuan.com/739815.html

https://www.itsvse.com/thread-2784-1-1.html

https://blog.csdn.net/a923751813/article/details/50511007

https://www.ruby-forum.com/topic/6875190

后面有时间开始debug继续出。

windows下vc编译和debug nginx的更多相关文章

  1. 原创 C++应用程序在Windows下的编译、链接:第一部分 概述

    本文是对C++应用程序在Windows下的编译.链接的深入理解和分析,文章的目录如下: 我们先看第一章概述部分. 1概述 1.1编译工具简介 cl.exe是windows平台下的编译器,link.ex ...

  2. C++应用程序在Windows下的编译、链接(一)概述

    C++应用程序在Windows下的编译.链接(一)概述 本文是对C++应用程序在Windows下的编译.链接的深入理解和分析,文章的目录如下: 我们先看第一章概述部分. 1概述 1.1编译工具简介 c ...

  3. ACE在windows下的编译及配置(VS2010)

    ACE在windows下的编译及配置(VS2010) 分类:             -[小西南]-              2013-08-06 16:17     2354人阅读     评论( ...

  4. Windows 下VC++6.0制作、使用动态库和静态库

    Windows 下VC++6.0制作.使用动态库和静态库 一.VC++6.0制作.使用静态库 静态库制作 1.如图一在VC++6.0中new一个的为win32 static library工程并新建一 ...

  5. Windows下PythonQt编译(vs2015+Qt5.11.2+PythonQt 3.2)探索

    时间:2018年10月20日 笔者最近在做Qt方面的开发工作,需用到脚本程序对程序内部进行扩展,就很自然的想到了PythonQt,下面介绍PythonQt在Windows下的的安装编译心得,水平有限, ...

  6. 【FFmpeg】Windows下FFmpeg编译

    由于FFmpeg是基于Linux开发的开源项目,源代码和Windows下最常见的Visual Studio提供的C/C++编译器不兼容,因此它不能使用MSVC++编译,需要在Windows下配置一个类 ...

  7. [转]QGis2.9在windows下的编译以及二次开发包下载

    今天心血来潮,将QGis在github上的代码更新后,又编译了一下.留意到源代码包里面的INSTALL文件有更新,于是本次编译完全基于官方的编译说明.编译过程非常顺利,除了在CMake的第一次conf ...

  8. windows下rabbitmq-c编译(带openssl、无需MinGW)

    因为项目原因,需要使用到rabbitmq的c客户端库.首先,参见上一篇windows下openssl编译,如果已经使用cmake编译过了,则先delete cache(File-Delete Cach ...

  9. 设置 Quick-Cocos2d-x 在 Windows 下的编译环境

    http://cn.cocos2d-x.org/tutorial/show?id=1304 设置 Quick-Cocos2d-x 在 Windows 下的编译环境 Liao Yulei2014-08- ...

随机推荐

  1. NetBeans issues and solutions.(build.xml and debug multiple projects)

    Copy a directory to another directory when building the .jar in NetBeans in the build.xml file. Solu ...

  2. 兼容PC和手机触摸代码

    测试环境:unity3d 4.6.1 using UnityEngine; using System.Collections; public class neccc : MonoBehaviour { ...

  3. shell基础:通配符和其他特殊符号

    这些东西可以用来批量删除:用× 通配符 其实就是基本用来匹配文件名

  4. c#之枚举,结构体

    1.枚举 2.结构体 例子1: using System; using System.Collections.Generic; using System.Linq; using System.Text ...

  5. 解决session只能被一个浏览器访问的问题

    做购物车的时候,我们都知道购买的东西会保存到session中,但是光这样简单的保存起来就会带来一个问题,只能呢被同一个浏览器访问到,如果用户使用不同的浏览器进行访问网页的话肯定是会出问题的.下面就来针 ...

  6. spring自带的定时任务功能@EnableScheduling

    1 demo package com.test.domi.config; import org.springframework.beans.factory.annotation.Configurabl ...

  7. Usefull Resources

    Sql Server Profiler 1. http://www.cnblogs.com/Fooo/archive/2013/02/19/2916789.html 2. http://5439255 ...

  8. 136. Single Number(位运算)

    Given a non-empty array of integers, every element appears twice except for one. Find that single on ...

  9. yii2验证密码->手机号码短信发送>手机短信发送频繁问题

    <?php namespace frontend\models; use Yii; use yii\base\Model; class ChangeMobileSendRequestForm e ...

  10. poj2987 求最大权闭合回路

    建图差不多和以前做的差不多,就是最后询问这个闭合子图有多少个的时候,只要输出这个图的S集合,就是进行dfs能遍历到的点一定在S集合中,不能遍历到的点在T集合中 #include <iostrea ...