I am trying to perform FFT using the FFTW lib available for c++. Since there are many options for FFTW available i am trying to implement fft using the rfftwnd method(since my data is real).
#include<rfftw.h>
{
fftw_real a[width][2*(height/2+1)],b[width][2*(height/2+1)],c[width][height];
fftw_complex *A,*B,C[width][height/2+1];
rfftwnd_plan rp,rpin;
fftw_real scale = 1.0/(width*height);
const int H = height;
const int W= width;
rp = rfftw2d_create_plan(W,H,FFTW_REAL_TO_COMPLEX,FFTW_ESTIMATE);
rpin = rfftw2d_create_plan(width, height, FFTW_COMPLEX_TO_REAL,FFTW_ESTIMATE);
A = (fftw_complex*) &a[0][0];
B = (fftw_complex*) &b[0][0];
for(int i=0;i<width;i++)
{
for (int j=0;j<height;j++)
{
a[i][j] = la(i,j);
}
}
}
So i am basically trying to implement the fft on an image for this i need to create the plans as suggested in the FFTW documentation. But when i do this i get an errror saying
error: undefined reference to `rfftw2d_create_plan'
could someone please help as to why this is happening? Am i missing something here?