nginx-rtmp-module
nginx-rtmp-module copied to clipboard
Fix compilation under Windows/MinGW64
Dear @arut,
Please merge this PR to compile properly under Windows / MinGW64 This PR also cover #1340
Regards.
Thanks. After hours of stress trying to figure out why it wouldn't build, merging this locally fixed the problem.
hello, i've got issues when compiling w64
objs/lib/nginx-rtmp-module-arut-modded-HerveAncher/ngx_rtmp_flv_module.c(508): error C2220: l'avertissement suivant est traité comme une erreur objs/lib/nginx-rtmp-module-arut-modded-HerveAncher/ngx_rtmp_flv_module.c(508): warning C4334: '<<' : résultat du décalage 32 bits converti implicitement en 64 bits (le décalage 64 bits est-il intentionnel ?) objs/lib/nginx-rtmp-module-arut-modded-HerveAncher/ngx_rtmp_flv_module.c(521): warning C4334: '<<' : résultat du décalage 32 bits converti implicitement en 64 bits (le décalage 64 bits est-il intentionnel ?) NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.EXE"' : code retour '0x2' Stop.
any advices ?
thanks.
Hi, In fact, I never try to compile Nginx with MSVC, I am using MSYS2.
The error MSVC returns telling you that the left shift imply that the temporary created variable potentially become a 64 bits, and to fix that I think you just have to convert:
(1 << h.type)
to:
(ngx_uint_t)(1 << h.type)
Another option is to tell MSVC to do not treat warning as error by removing the flag /WX
in compiler option:
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2220?view=msvc-170
Hi, In fact, I never try to compile Nginx with MSVC, I am using MSYS2.
The error MSVC returns telling you that the left shift imply that the temporary created variable potentially become a 64 bits, and to fix that I think you just have to convert:
(1 << h.type)
to:
(ngx_uint_t)(1 << h.type)
hi ! i modified lines 508 and 521 like you said in ngx_rtmp_flv_module.c and it's now working like expected (compiling nginx with your RTMP module in 64 bits with MSVC). Thanks so much