fftw in Visual Studio?

Nate Parsons picture Nate Parsons · Apr 28, 2010 · Viewed 11.3k times · Source

I'm trying to link my project with fftw and so far, I've gotten it to compile, but not link. As the site said, I generated all the .lib files (even though I'm only using double precision), and copied them to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib, the .h file to C:\Program Files\Microsoft Visual Studio 9.0\VC\include and the .dll to C:\windows\system32.

I've copied the tutorial program, and the exact error I am getting is:

1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_free referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_destroy_plan referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_execute referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_plan_dft_1d referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_malloc referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)

So, what could be wrong with my project setup? Thanks!

Answer

Wilson Jin picture Wilson Jin · Apr 11, 2012

My case

Using FFTW in Visual Studio 2010

Precompiled FFTW 3.3.1 Windows DLLs install using fftw-3.2.1-dll.zip, on my Windows XP machine.

  1. Open cmd window and go to lib.exe folder C:\Program Files\Microsoft Visual Studio 10.0\VC\bin>
  2. Type lib /def:libfftw3-3.def
  3. Type lib /def:libfftw3f-3.def
  4. Type lib /def:libfftw3l-3.def
  5. If you have a error on command, copy any mspdb80.dll or mspdb100.dll file to in bin directory.
  6. You will get 6 files

    libfftw3-3.exp, libfftw3-3.lib, libfftw3f-3.exp, libfftw3f-3.lib, libfftw3l-3.exp and libfftw3l-3.lib

    and copy it to programming directory.

  7. Delete all mspdb80.dll or mspdb100.dll file from bin directory.

  8. Closed Project and open again and rebuild it again.