I'm using Visual Studio 2012 on a 64-bit operating system. I'm trying to use FFTW in a program, but having problems getting the libraries to link.
I downloaded the 64-bit package from the FFTW Windows page. I followed these steps:
lib /machine:x64 /def:libfftw3-3.def
lib /machine:x64 /def:libfftw3f-3.def
lib /machine:x64 /def:libfftw3l-3.def
This created the .exp and .lib files.
I added the path with all of the files in:
Properties -> Debugging -> Environment Properties -> VC++ Directories -> Include Directories Properties -> C/C++ -> General -> Additional Include Directories Properties -> Linker -> General -> Additional Library Directories
I added the .lib files to Properties -> Linker -> Input -> Additional Dependencies
I added the following lines to the top of my code:
#define FFTW_DLL
#include <fftw3.h>
then I put the sample code from the FFTW tutorial into my code, like so:
fftw_complex *in;
fftw_complex *out;
fftw_plan p;
in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*L);
out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*L);
p = fftw_plan_dft_1d(L, in, out,FFTW_FORWARD,FFTW_MEASURE);
fftw_execute(p);
fftw_destroy_plan(p);
fftw_free(in);
fftw_free(out);
When I then try to build my application, I get the following error:
Error 1 error LNK2019: unresolved external symbol __imp__fftw_execute referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 2 error LNK2019: unresolved external symbol __imp__fftw_plan_dft_1d referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 3 error LNK2019: unresolved external symbol __imp__fftw_destroy_plan referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 4 error LNK2019: unresolved external symbol __imp__fftw_malloc referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 5 error LNK2019: unresolved external symbol __imp__fftw_free referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 6 error LNK1120: 5 unresolved externals C:\EEG_Hardware\source\dspApp\ConsoleApplication1\Debug\ConsoleApplication1.exe ConsoleApplication1
I've been searching through this site, trying any solution I can find, but so far no luck. Any assistance would be greatly appreciated!