Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

c++ - Compilation Error VisualStudio 2019: complex double

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...