Fftw in Visual Studio?

I am trying to link my project with fftw and so far, I got it for compilation, but not for reference. As the site said, I generated all the .lib files (although I use only double precision) and copied them to the C:\Program Files\Microsoft Visual Studio 9.0\VC\lib.h file on C:\Program Files\Microsoft Visual Studio 9.0\VC\includeand the .dll on C:\windows\system32.

I copied the curriculum, and the exact error I get 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? Thank!

+3
source share
4 answers

Are you really connected to the library in the project you are building?

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

You need to add the library file name to this field.

+2
source

My case

FFTW Visual Studio 2010

FFTW 3.3.1 Windows DLL fftw-3.2.1-dll.zip Windows XP.

  • cmd lib.exe C:\Program Files\Microsoft Visual Studio 10.0\VC\bin>
  • lib /def:libfftw3-3.def
  • lib /def:libfftw3f-3.def
  • lib /def:libfftw3l-3.def
  • , mspdb80.dll mspdb100.dll bin.
  • 6

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

    .

  • mspdb80.dll mspdb100.dll bin.

  • .

+3

Assuming you really linked your project with lib and it doesn't work, use /verbose:liband paste the output of this and the output

dumpbin /exports fftw.lib | findstr fftw_free
0
source

I had a similar problem. What helped build fftw libs with this help Compiling the FFTW Source in Visual Studio . In fact, the problem was more closely the compilation of my Win 32 application and the attempt to use x64 libraries. So make sure the platform is the same.

0
source

Source: https://habr.com/ru/post/1743120/


All Articles