View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007690 | ardour | bugs | public | 2018-11-24 11:30 | 2019-12-29 07:04 |
Reporter | aquilarubra | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86_64 | OS | Windows | OS Version | 10 |
Product Version | 5.X git (version in description) | ||||
Summary | 0007690: M_PI compilation issues | ||||
Description | math.h is not included in all the required places, at least while compiling with mingw-w64. To compile correctly, I currently need to modify the source: sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/base/KaiserWindow.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/base/Window.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/base/SincWindow.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/qm-dsp/maths/MathUtilities.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/vamp-plugins/TruePeak.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/zita-resampler/zita-resampler/resampler-table.h sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/pbd/boost_debug.cc sed -i '1s/^/#ifndef M_PI\n #define M_PI 3.14159265358979323846\n#endif/' libs/pbd/cartesian.cc I used the usual definition of M_PI from math.h, but for better precision it can be: #define M_PI 3.14159265358979323846264338327950288 #define M_PI | ||||
Tags | No tags attached. | ||||
|
Could you please provide actual compiler invocation, flags and output how those fail and what the issue is that you address? qm-dsp is C++ library. KaiserWindow.h for example does #include <cmath> for C's math.h libs/pbd/cartesian.cc does have a <math.h> include.. It does compiles just fine with mingw-w64: https://nightly.ardour.org/i/A_WIN_x86_64/build_log.txt Also John Emmas maintains a MSVC build where this isn't an issue apparently. |
|
John Emmas probably has _USE_MATH_DEFINES defined in his MSVC build config. Newer versions of mingw-w64 also require this AFAIR, I guess to be more like MSVC headers. Perhaps also see: https://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio/ |
|
I was also perplex, because it seemed to me that there was the <cmath> include, but it wasn't picked up. Anyway, since last week I saw there was a important revamp of the code, which passed from 1031 compilation cases to 999. Now it works. No errors any longer. |
|
Works with actual source |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-11-24 11:30 | aquilarubra | New Issue | |
2018-11-24 13:17 | x42 | Note Added: 0020477 | |
2018-11-24 22:46 | timbyr | Note Added: 0020478 | |
2018-11-25 07:22 | aquilarubra | Note Added: 0020486 | |
2019-12-29 07:04 | aquilarubra | Status | new => closed |
2019-12-29 07:04 | aquilarubra | Resolution | open => fixed |
2019-12-29 07:04 | aquilarubra | Note Added: 0020874 |