Opened 8 months ago
Last modified 4 weeks ago
#2423 open defect
Undeclared constant 'M_PI' in xvid_vbr macro 'DEG2RAD'
Reported by: | bug | Owned by: | beastd |
---|---|---|---|
Priority: | normal | Component: | build system |
Version: | HEAD | Severity: | blocker |
Keywords: | xvid_vbr maths constants | Cc: | LigH |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description (last modified by )
Summary of the bug:
Undeclared constant 'M_PI' in xvid_vbr macro 'DEG2RAD'
How to reproduce:
Compiling mencoder in media-autobuild suite (MSYS2/MinGW, GCC 13.2)
xvid_vbr.c: In function 'vbr_init_2pass2': xvid_vbr.c:44:18: error: 'M_PI' undeclared (first use in this function) 44 | #define DEG2RAD (M_PI / 180.0) | ^~~~ xvid_vbr.c:887:53: note: in expansion of macro 'DEG2RAD' 887 | (1.0 + sin(DEG2RAD * (state->average_frame * 90.0 / state->alt_curve_low_diff))); | ^~~~~~~ xvid_vbr.c:44:18: note: each undeclared identifier is reported only once for each function it appears in 44 | #define DEG2RAD (M_PI / 180.0) | ^~~~ xvid_vbr.c:887:53: note: in expansion of macro 'DEG2RAD' 887 | (1.0 + sin(DEG2RAD * (state->average_frame * 90.0 / state->alt_curve_low_diff))); | ^~~~~~~ xvid_vbr.c: In function 'vbr_getquant_2pass2': xvid_vbr.c:44:18: error: 'M_PI' undeclared (first use in this function) 44 | #define DEG2RAD (M_PI / 180.0) | ^~~~ xvid_vbr.c:1250:84: note: in expansion of macro 'DEG2RAD' 1250 | sin(DEG2RAD * ((dbytes - state->average_frame) * 90.0 / state->alt_curve_high_diff))); | ^~~~~~~
Attachments (5)
Change History (21)
comment:1 by , 8 months ago
Description: | modified (diff) |
---|
by , 7 months ago
Attachment: | 0001-xvid_vbr-Include-lavu-mathematics.h-to-make-sure-the.patch added |
---|
comment:2 by , 7 months ago
Status: | new → open |
---|
comment:3 by , 6 months ago
The reason might be GCC 14.1 with stricter default warnings-as-errors than 13.2 before.
Patch applied; error moved to libaf/af_equalizer.c
comment:4 by , 6 months ago
Cc: | added |
---|
comment:5 by , 6 months ago
Ah OK that might be related. GCC 14 will definitely need some more work...
I have put a patch on the mplayer development mailing list:
https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2024-April/074173.html
But it is not really the way to fix those problems, but if you need GCC 14 build, it should probably work in practice.
comment:6 by , 6 months ago
I may mention it in the M-AB-S issues, but will probably wait for your official commit and the closing of this ticket (there is only little need for mplayer/mencoder in these days). For now, thank you for your efforts.
comment:7 by , 5 months ago
So that was in April ... the mailing list contains a few steps of success but no final result, AFAICS.
And April is the last archived month of this mailing list. May 2024 does not even exist anymore.
comment:9 by , 8 weeks ago
Could you please try to build again with latest MPlayer development version (SVN r38666)?
Edit:
And possibly with attachment:0001-xvid_vbr-Include-lavu-mathematics.h-to-make-sure-the.patch applied on top.
by , 8 weeks ago
Attachment: | mplayer_unpatched.zip added |
---|
Build and install logs of unpatched mplayer
by , 8 weeks ago
Attachment: | 0001-Include-lavu-mathematics.h-everywhere-M_PI-is-used.patch added |
---|
comment:11 by , 8 weeks ago
Please give it a try with this new patch attachment:0001-Include-lavu-mathematics.h-everywhere-M_PI-is-used.patch I just attached.
comment:12 by , 8 weeks ago
On it. Will attach when done. The logs are huge now, many more warnings and errors...
comment:13 by , 7 weeks ago
@LigH: The latest errors look as if they are because of your LDFLAGS
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc -static-libstdc++
Not really sure about this, but maybe try to add standard C++ lib to the LDFLAGS:
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc -static-libstdc++ -lstdc++
Did statically linking standard C++ lib work before?
comment:14 by , 7 weeks ago
I am not really a developer, I only let the media-autobuild suite run and hope that it builds mplayer successfully; if not, I can interpret the errors as halfwit and ask more competent people for opinions.
I mentioned your suggestion in the M-AB-S issue 2702
comment:16 by , 4 weeks ago
Solution in M-AB-S: Use gnu11
instead of c11
as C++ version in configure, and CXX
instead of CC
as compiler and linker
Thanks for the report!
Do you know what changed so this is a problem now?
For me it always worked so far. Unfortunately
M_PI
seems to be in not even a single C standard so far...Does attachment:0001-xvid_vbr-Include-lavu-mathematics.h-to-make-sure-the.patch fix the problem for your builds?