Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation under Windows/MinGW64 #1564

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HerveAncher
Copy link

Dear @arut,

Please merge this PR to compile properly under Windows / MinGW64
This PR also cover #1340

Regards.

@elijahr2411
Copy link

Thanks. After hours of stress trying to figure out why it wouldn't build, merging this locally fixed the problem.

@Broukmiken
Copy link

Broukmiken commented Sep 14, 2022

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.

@HerveAncher
Copy link
Author

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)

@HerveAncher
Copy link
Author

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

@Broukmiken
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants