Closed 9Morello closed 8 years ago
Someone else reported the same to the upstream developer and he fixed it by including <cmath>
. I hope it works now.
@darealshinji Thanks for the fast answer. I got another problem while building it:
make[1]: Entering directory '/home/morello/vapoursynth-plugins/plugins/fft3dfilter'
CXX src/fft3dfilter_c.o
src/fft3dfilter_c.cpp: In function ‘void ApplyWiener2D_C(float (*)[2], int, int, int, int, float, float, float, float, float, const float*, float, const float*, float)’:
src/fft3dfilter_c.cpp:74:158: error: ‘sqrt’ was not declared in this scope
WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ); // sharp
^
src/fft3dfilter_c.cpp:114:158: error: ‘sqrt’ was not declared in this scope
WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) *
^
src/fft3dfilter_c.cpp: In function ‘void Sharpen_C(float (*)[2], int, int, int, int, float, float, float, const float*, float, const float*, float)’:
src/fft3dfilter_c.cpp:680:151: error: ‘sqrt’ was not declared in this scope
sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) ) ;
^
src/fft3dfilter_c.cpp:723:151: error: ‘sqrt’ was not declared in this scope
sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) ) *
^
src/fft3dfilter_c.cpp: In function ‘void Sharpen_degrid_C(float (*)[2], int, int, int, int, float, float, float, const float*, float, const float (*)[2], float, const float*, float)’:
src/fft3dfilter_c.cpp:772:151: error: ‘sqrt’ was not declared in this scope
sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) )) ;
^
src/fft3dfilter_c.cpp:837:151: error: ‘sqrt’ was not declared in this scope
sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) )) *
^
src/fft3dfilter_c.cpp: In function ‘void ApplyWiener2D_degrid_C(float (*)[2], int, int, int, int, float, float, float, float, float, const float*, float, const float (*)[2], float, const float*, float)’:
src/fft3dfilter_c.cpp:916:158: error: ‘sqrt’ was not declared in this scope
WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ); // sharp
^
src/fft3dfilter_c.cpp:980:158: error: ‘sqrt’ was not declared in this scope
WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) *
^
../../cxx.inc:14: recipe for target 'src/fft3dfilter_c.o' failed
That's the square root function defined in math.h
.
I've added #include <math.h>
and make the plugin link with -lm
as suggested here.
Which gcc version are you using? It's weird that I've never had issues with gcc 4.8.
I'm using 5.3.1 (the one Debian Testing currently ships with). I'll try compiling again.
Edit:
I got a similar error.
src/FFT3DFilter.cpp: In function ‘void SigmasToPattern(float, float, float, float, int, int, int, float, float*)’:
src/FFT3DFilter.cpp:200:38: error: ‘sqrt’ was not declared in this scope
constexpr float ft2 = sqrt( 0.5f ) / 2; /* frequency for sigma2 */
^
src/FFT3DFilter.cpp: In constructor ‘FFT3DFilter::FFT3DFilter(float, float, int, int, int, int, int, int, float, float, float, float, float, float, bool, bool, int, int, int, int, bool, float, float, float, float, float, float, float, float, float, int, int, VSVideoInfo, VSNodeRef*)’:
src/FFT3DFilter.cpp:398:62: error: ‘cosf’ was not declared in this scope
wanxl[i] = cosf( pi * (i - ow + 0.5f) / (ow * 2) ); /* left analize window (half-cosine) *
^
src/FFT3DFilter.cpp:403:62: error: ‘cosf’ was not declared in this scope
wanyl[i] = cosf( pi * (i - oh + 0.5f) / (oh * 2) );
^
src/FFT3DFilter.cpp:424:68: error: ‘cosf’ was not declared in this scope
wanxl[i] = sqrt( cosf( pi * (i - ow + 0.5f) / (ow * 2) ) );
^
src/FFT3DFilter.cpp:424:70: error: ‘sqrt’ was not declared in this scope
wanxl[i] = sqrt( cosf( pi * (i - ow + 0.5f) / (ow * 2) ) );
^
src/FFT3DFilter.cpp:429:68: error: ‘cosf’ was not declared in this scope
wanyl[i] = sqrt( cosf( pi * (i - oh + 0.5f) / (oh * 2) ) );
^
src/FFT3DFilter.cpp:429:70: error: ‘sqrt’ was not declared in this scope
wanyl[i] = sqrt( cosf( pi * (i - oh + 0.5f) / (oh * 2) ) );
^
src/FFT3DFilter.cpp:460:63: error: ‘cosf’ was not declared in this scope
wsynxl[i] = cosf( pi * (i - ow + 0.5f) / (ow * 2) );
^
src/FFT3DFilter.cpp:467:63: error: ‘cosf’ was not declared in this scope
wsynyl[i] = cosf( pi * (i - oh + 0.5f) / (oh * 2) );
^
src/FFT3DFilter.cpp:484:66: error: ‘exp’ was not declared in this scope
wsharpen[i] = 1 - exp( -d2 / (2 * scutoff * scutoff) );
^
src/FFT3DFilter.cpp:502:52: error: ‘exp’ was not declared in this scope
wdehalo[i] = exp( -0.7f * d2 * hr * hr ) - exp( -d2 * hr * hr ); /* some window with max a
^
src/FFT3DFilter.cpp:527:46: error: ‘sqrtf’ was not declared in this scope
sigmaNoiseNormed2D = sigma / sqrtf( norm );
^
src/FFT3DFilter.cpp: In function ‘void SetPattern(const float (*)[2], int, int, int, int, int, int, int, const float*, float*, float&, float, const float (*)[2])’:
src/FFT3DFilter.cpp:1271:60: error: ‘sqrt’ was not declared in this scope
psigma = sqrt( sigmaSquared / (weight * bh * outwidth) ); /* mean std deviation (sigma) */
Okay, so that one needed math.h
too. It should now work (I hope).
@darealshinji This time, "make" worked, but I'm getting an error when trying to install it with "sudo make install":
Makefile:23: *** unterminated call to function 'foreach': missing ')'. Stop.
Should work now.
@darealshinji It worked now, thanks!
Hello. I'm getting the following errors when using make:
I'm trying to compile it on Debian Testing. I installed all dependencies without problems.