Error using CUFFT and OPENGL

Hi everyone,

i have a question, if somebody knows, please answer me.
When i trying to compile my code, appears an error like this:

1>imageDenoising.cu.obj : error LNK2019: símbolo externo _cufftDestroy@4 sin resolver al que se hace referencia en la función _cuda_Copy
1>imageDenoising.cu.obj : error LNK2019: símbolo externo _cufftExecR2C@12 sin resolver al que se hace referencia en la función _cuda_Copy
1>imageDenoising.cu.obj : error LNK2019: símbolo externo _cufftPlan1d@16 sin resolver al que se hace referencia en la función _cuda_Copy

i’m calling a kernel from a .cpp file, and, in this “.cu” file i do this:

#include <stdio.h>
#include <math.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cufft.h>
#include <cutil_inline.h>

extern “C” void
cuda_Copy(TColor *d_dst, int imageW, int imageH)
{

cufftHandle plan;
cufftComplex *data;
    
    for(int i=  0 ; i < imageW*imageH ; i++){
            data[i].x = d_dst[i];
            data[i].y = 0;
    }

cudaMalloc((void**)&data, sizeof(cufftComplex)*(imageW/2+1)*imageH);


cufftPlan1d(&plan, imageW, CUFFT_R2C, imageH);


cufftExecR2C(plan, (cufftReal*)data, data);


cufftDestroy(plan);

cudaFree(data);    

}

i’m trying to apply a FFT with CUFFT to an image that i’ve loaded to “d_dst”. But errors appear. What am I doing wrong?

It seems that you didn’t link the cufft library…

Did you have “-lcufft” when linking?