CUFFT linking error

Hi,

I’m trying to excecute the code below.
Compiling works but execution returns a linking error.

I got the following error message:

1>sample.obj : error LNK2019: unresolved referece to external symbol _cufftPlan1d@16 non risolto in fucntion _main
1>C:\Documents and Settings\pc\Documenti\Visual Studio 2005\Projects\FFT\Debug\FFT.exe : fatal error LNK1120: 1 external link unresolved

CUDA CODE
#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>
#include <cutil.h>
#include <cuda.h>
#include <cufft.h>
#define NX 256
#define BATCH 1

int main(int argc, char** argv){
CUT_DEVICE_INIT(argc,argv);
const int N=20;
float* h_a, * h_t ,d_a;
//Allocation on host
h_a=new float[N];
h_t=new float[2
N];
//Data input
for (int i=0;i<N;i++){
h_a[i]=1;
}
size_t size=Nsizeof(float);
//Allocation on device
cudaMalloc((void**)& d_a, size);
cudaMemcpy(d_a, h_a, size, cudaMemcpyHostToDevice);
cufftHandle plan;
cufftComplex data;
cudaMalloc((void
*)&data, sizeof(cufftComplex)
(NX/2+1)*BATCH);
// Create a 1D FFT plan.
cufftPlan1d(&plan, NX, CUFFT_R2C, BATCH);
return 0;
}

Does anybody know what is the issue?

Thanks.

you must add to link a cufft.lib

I’m sorry, but i don’t manage to add to link a cufft.lib.
Could anybody tell me how to do it?

click right button on your project name. Then click on properties. Then configuration properties, linker, input. In additional dependencies you must write cufft.lib and OK.

Thanks for your help! I have solved my problem.

Hi, i’ve the same problems but i have not solved with this procedure.
in first time i’ve got the following messages:

error LNK2019: unresolved referece to external symbol _cufftPlan1d@16 referenced in fucntion _main
error LNK2019: unresolved referece to external symbol _cufftExecC2C@16 referenced in fucntion _main
error LNK2019: unresolved referece to external symbol _cufftDestroy@4 referenced in fucntion _main
error LNK1120: 3 unresolved externals

after i set the following configuration properties:

Project-> Properties-> Configuration Properties->Linker->Input->Additional Dependencies and i’ve written “cufft.lib”.

after i’ve got the second error message:

error LNK1104: cannot open file 'cufft.lib'

so i set the following:

Project->Properties->Configuration Properties->VC++ Directories->Library Directories and i added "C:\Program files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\lib\x64

i rebuilded the source cod but now i’ve again the first error

Please help me!
Best regards