English 中文(简体)
fftw3 on windows 64-bit
原标题:

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?

最佳回答

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.

问题回答

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).





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签