Re: [Dev-C++] Problems with linking FFTW library
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Daniel K. O. <dan...@ya...> - 2004-10-21 20:15:44
|
Cary Haynie wrote: >Those errors look would suggest that your missing a header file or something. > > Actually, it suggests that the lib is missing from the linking stage. >>I am still getting the same errors even with fftw-2.1.5. version. >> >>c:\dev-c++\examples\fft\fft.o(.text+0x29):fft.cpp: undefined reference >>to `fftw_malloc' >> >> I didn't test the 2.1.5 version (I don't even know what's a FFT library for), but the 3.0.1 binary available at http://www.fftw.org works out of the box. Seems that you aren't linking to the lib. Make sure to put every file in its right place. The .h file goes to the include folder, the .dll goes to somewhere in your path, and the other files go to your lib folder. Then in your project options you have to add the .lib file to the linker options. This (from http://www.fftw.org/fftw3_doc/Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs ) compiles and runs fine: --- #include <fftw3.h> int main(void) { fftw_complex *in, *out; fftw_plan p; int N=16; in = fftw_malloc(sizeof(fftw_complex) * N); out = fftw_malloc(sizeof(fftw_complex) * N); p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE); fftw_execute(p); /* repeat as needed */ fftw_destroy_plan(p); fftw_free(in); fftw_free(out); return 0; } --- Daniel K. O. |