Skip to content

[bug] Can't use cl.exe to compile #163

@rsp4jack

Description

@rsp4jack

// English

Expected behavior

Compile successfully.

Actual behavior

cl.exe version: Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x64
nmake.exe version: Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Compile Error, it error :

cl -c -O2  -W4 -WX -nologo -MT -Zi -Fdobjs/nginx.pdb -DFD_SETSIZE=1024 -DNO_SYS_TYPES_H -Yungx_config.h -Fpobjs/ngx_config.pch -I src/core  -I src/event  -I src/event/modules  -I src/os/win32  -I objs/lib/nginx-http-flv-module  -I objs/lib/pcre-8.44  -I objs/lib/openssl-1.1.1g/openssl/include  -I objs/lib/zlib-1.2.11  -I objs  -I src/http  -I src/http/modules  -I objs/lib/nginx-http-flv-module  -Foobjs/addon/nginx-http-flv-module/ngx_rtmp_flv_module.obj  objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c
ngx_rtmp_flv_module.c

objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c(508): error C2220: warning treated as error - no 'object' file generated
objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c(508): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c(521): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.

Steps to reproduce the behavior

Use MSYS2 to run 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 --with-cc-opt=-DFD_SETSIZE=1024 --with-openssl-opt=no-asm --with-select_module --with-openssl-opt=no-asm --add-module=objs/lib/nginx-http-flv-module --with-http_ssl_module --add-module=objs/lib/echo-nginx-module --with-openssl=objs/lib/openssl-1.1.1g --with-zlib=objs/lib/zlib-1.2.11 --with-pcre=objs/lib/pcre-8.44, it configure successfully, and run nmake in "VS2015 x64 Native Tools Command Prompt", it error.

// 中文/Chinese
期望结果: 成功编译
实际结果: 编译失败, 报错内容:

cl -c -O2  -W4 -WX -nologo -MT -Zi -Fdobjs/nginx.pdb -DFD_SETSIZE=1024 -DNO_SYS_TYPES_H -Yungx_config.h -Fpobjs/ngx_config.pch -I src/core  -I src/event  -I src/event/modules  -I src/os/win32  -I objs/lib/nginx-http-flv-module  -I objs/lib/pcre-8.44  -I objs/lib/openssl-1.1.1g/openssl/include  -I objs/lib/zlib-1.2.11  -I objs  -I src/http  -I src/http/modules  -I objs/lib/nginx-http-flv-module  -Foobjs/addon/nginx-http-flv-module/ngx_rtmp_flv_module.obj  objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c
ngx_rtmp_flv_module.c

objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c(508): error C2220: warning treated as error - no 'object' file generated
objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c(508): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
objs/lib/nginx-http-flv-module/ngx_rtmp_flv_module.c(521): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.

复现方法:
cl.exe 版本: Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x64
nmake.exe 版本: Microsoft (R) Program Maintenance Utility Version 14.00.24210.0

使用MSYS2运行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 --with-cc-opt=-DFD_SETSIZE=1024 --with-openssl-opt=no-asm --with-select_module --with-openssl-opt=no-asm --add-module=objs/lib/nginx-http-flv-module --with-http_ssl_module --add-module=objs/lib/echo-nginx-module --with-openssl=objs/lib/openssl-1.1.1g --with-zlib=objs/lib/zlib-1.2.11 --with-pcre=objs/lib/pcre-8.44,运行成功,没有报错。然后使用"VS2015 x64 Native Tools Command Prompt",运行nmake,报错。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions