English 中文(简体)
fftw in Visual Studio?
原标题:

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 FilesMicrosoft Visual Studio 9.0VClib, the .h file to C:Program FilesMicrosoft Visual Studio 9.0VCinclude and the .dll to C:windowssystem32.

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!

最佳回答

Have you actually linked against the library in the project you re building?

Project -> Properties -> Linker -> Input -> Additional dependencies

You need to add the library s filename to that field.

问题回答

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 FilesMicrosoft Visual Studio 10.0VCin>
  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.

Assuming you ve actually linked your project against the lib and it doesn t work, use /verbose:lib and paste the output of that and the output of

dumpbin /exports fftw.lib | findstr fftw_free

I had similar problem. What helped was compiling the fftw libs with this help Compiling FFTW source in Visual studio. Actually more closely the problem was compiling my application Win 32 and trying to use x64 -libraries. So make sure the platform is same.





相关问题
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?

热门标签