0
votes

I would like to use FFTW3 on Windows-64 bit. I follow the instructions on FFTW website: download the package, unzip, run lib.exe to create .lib "import libraries".

After doing so, I build my application (which runs just fine using FFTW3 dlls 32-bit) and I get the following errors:

1>pyramidTransform.obj : error LNK2019: unresolved external symbol __imp_fftw_destroy_plan referenced in function "int __cdecl fourier2spatialband1(int,int,float *,float ,double ()[2],double ()[2],double ()[2])" (?fourier2spatialband1@@YAHHHPEAM0PEAY01N11@Z) 1>pyramidTransform.obj : error LNK2019: unresolved external symbol __imp_fftw_execute referenced in function "int __cdecl fourier2spatialband1(int,int,float *,float ,double ()[2],double ()[2],double ()[2])" (?fourier2spatialband1@@YAHHHPEAM0PEAY01N11@Z) 1>pyramidTransform.obj : error LNK2019: unresolved external symbol __imp_fftw_plan_dft_2d referenced in function "int __cdecl fourier2spatialband1(int,int,float *,float ,double ()[2],double ()[2],double ()[2])" (?fourier2spatialband1@@YAHHHPEAM0PEAY01N11@Z) 1>pyramidTransform.obj : error LNK2019: unresolved external symbol __imp_fftw_free referenced in function "int __cdecl decompose(int,int,float *,int,int,float * *,float * *,float *,float * * *,float * * *,float * *,float * *)" (?decompose@@YAHHHPEAMHHPEAPEAM10PEAPEAPEAM211@Z) 1>pyramidTransform.obj : error LNK2019: unresolved external symbol __imp_fftw_malloc referenced in function "int __cdecl decompose(int,int,float *,int,int,float * *,float * *,float *,float * * *,float * * *,float * *,float * *)" (?decompose@@YAHHHPEAMHHPEAPEAM10PEAPEAPEAM211@Z)

The property pane for Additional Dependencies clearly shows that I am linking to libfftw3-3.lib (created above).

How can I tell what Visual Studio trying to link to? Has anyone have any luck with FFTW-3 in Windows 64-bit?

2

2 Answers

2
votes

I found the problem. With FFTW3, since the authors have already compiled the DLLs for Windows, you need to create import libraries (.lib) files from the supplied .def files. You do so by going to the Visual Studio 2008 command prompt:

lib /def:libfftw3-3.def

Microsoft (R) Library Manager Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

LINK : warning LNK4068: /MACHINE not specified; defaulting to X64
Creating library libfftw3f-3.lib and object libfftw3f-3.exp

The problem was that I must have started the wrong command prompt when I first created these .lib files.

More instructions can be found at FFTW Windows website.

It is also important to note that if you're following the steps from the above website, you're gonna need to run the commands from a folder that doesn't require administrator privileges. By doing this, you'll be able to get your .lib files. Then, you just copy them into the VS lib folder and you're ready to go.

1
votes

You are linking against the 64-bit version of the libraries, no? You said that it runs fine with the FFTW3 32-bits DLLs, so it sounds like you are using 32-bit libraries. 64-bit builds cannot link against a 32-bit library (or a 32-bit DLL for that matter).