views:

404

answers:

2

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!

+2  A: 

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.

Stu Mackellar
Thanks! I was expecting it to be something simple like that.
drhorrible
A: 

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
Alex