在win11系统上将模块编译进 NGINX 报错
Closed this issue · 1 comments
chenmonster commented
环境
- win11
- vs 2022
- nginx-release-1.27.2
- zlib-1.3.1
- pcre2-10.39
- openssl-3.0.15
- nginx-http-flv-module-1.2.11
编译
生成配置
cd nginx-release-1.27.2
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-zlib=objs/lib/zlib-1.3.1 \
--with-pcre=objs/lib/pcre2-10.39 \
--with-openssl=objs/lib/openssl-3.0.15 \
--with-openssl-opt=no-asm \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_sub_module \
--with-http_stub_status_module \
--add-module=objs/lib/nginx-http-flv-module-1.2.11编译打包
在 x64 Native Tools Command Prompt for VS 2022 中执行 nmake 报错如下
objs/lib/nginx-http-flv-module-1.2.11/hls/ngx_rtmp_mpegts_crc.c(81): fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "ngx_config.h"”?
winshining commented
用 clone 的代码编译吧, 这个问题的修复没有包含在 1.2.11 版本里, 详情见: #237.
