Forums

fftw comiling error

Started by Unknown March 27, 2006
Good Day,

 I have been trying to compile fftw on my linux computer but I get
error.

 code is;


 #include <fftw.h>
int main()
 {
     int N=28;

      fftw_complex in[N], out[N];
      fftw_plan p;

      p = fftw_create_plan(N, FFTW_FORWARD, FFTW_ESTIMATE);

      fftw_one(p, in, out);

      fftw_destroy_plan(p);
 }


 error messege::
> > linux:~ # gcc -lfftw3 -o fft fft.c > /tmp/ccz658bq.o(.text+0x7d): In function `main\': > fft.c: undefined reference to `fftw_create_plan\' > /tmp/ccz658bq.o(.text+0x90):fft.c: undefined reference to `fftw_one\' > /tmp/ccz658bq.o(.text+0x9e):fft.c: undefined reference to
`fftw_destroy_plan\'
> collect2: ld returned 1 exit status
> > My e-mail address is kxs322@yahoo.com > The reason I wrote my e mail address is > I don't know how to check reply on this forum. > > Thanks in anticipation. > Ahmad
Two problems.  First, your link flags are in the wrong order (see Q3.12
in the FFTW FAQ).  Second, you are calling functions from FFTW 2.x but
are linking FFTW 3.x, which has a different API.

Cordially,
Steven G. Johnson