Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to add .cu file to OPENCV source without obtain linked error

Hi everybody. I would like to know how to add .cu file to the OPENCV source. To test a CUDA function, I have written a simple function who adds a value to all pixels of matrix. But when I compile the project, I obtain link error. I follow the same scheme as for pyrup functions: - Templates functions in .cu file - I create the declaration of the host function in the gpu.hpp file and I create a .cpp file in which I define the host function (which called the CUDA function). If I put my function in original sources files (pyr_up.cu , gpu.hpp, pyramids.cpp), I can build the solution and access to the function, but not if I create new files… I’ve got one error by each type of data, they all looks like to : Erreur 101 error LNK2001: symbole externe non résolu "void __cdecl cv::gpu::device::imgproc::test_gpu<float>(struct cv::gpu::DevMem2D_<unsigned char="">,struct cv::gpu::DevMem2D_<unsigned char="">,struct CUstream_st *)" (??$test_gpu@M@imgproc@device@gpu@cv@@YAXU?$DevMem2D_@E@23@0PAUCUstream_st@@@Z) F:\install_opencv_cuda_modif\modules\gpu\testCuda.obj