I have integrated WindowFunctions by Window Functions Github into my project using window_functions.c and .h.
Everything compiles ok with the exception of any function using complex double.
The errors I get are
1>windFcns.c
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(540,38): error C2143: syntax error: missing ')' before 'type'
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(540,41): error C2085: 'z': not in formal parameter list
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(540,52): error C2059: syntax error: 'type'
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(540,56): error C2059: syntax error: ')'
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(605,31): error C2143: syntax error: missing ')' before 'type'
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(605,34): error C2085: 'z': not in formal parameter list
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(605,45): error C2059: syntax error: 'type'
1>G:VSProcessAppsfftwRealDoublefftRealDoublecubicSplineServerwindFcns.c(605,118): error C2059: syntax error: ')'*
I noticed the comment on the github page::
FFT
...
Note that the array pointer is a pointer-to-double rather than a pointer-to-complex-double. This enables the same prototype to be used from C++, which defines complex numbers via templates rather than as a built-in type in the language. Use casting to convert to type from a complex double pointer to a double pointer on ionvocation.
But I didn't understand this.
I also noted that the header declaration for the fft function was different from it's implementation:
void fft(double* z, unsigned size, bool inv);
static void fft_radix2(complex double* z, unsigned size)
I was puzzled by this.
I am using fftw within this project which uses complex numbers with no issues.
Can anyone help me with this?
question from:
https://stackoverflow.com/questions/65946367/compilation-error-visualstudio-2019-complex-double 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…