windows下vc編譯和debug nginx

來源:互聯網
上載者:User

標籤:tps   文檔   cli   out   logs   tsv   bin   時間   class   

總體來說,各個步驟以及版本參考官方文檔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 objsmkdir objs/libcd objs/libtar -xzf ../../pcre-8.41.tar.gztar -xzf ../../zlib-1.2.11.tar.gztar -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

51701865

13989337

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

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

50511007

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

後面有時間開始debug繼續出。

windows下vc編譯和debug nginx

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.