Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building OpenCV 2.4.6 with CUDA 5.5RC in VS2012

Has anybody succeeded in building OpenCV 2.4.6. with CUDA 5.5RC in VS2012 c++/cli?

I am running the above in Windows 8 64 bit.

While most of OpenCV builds, five projects will not and I am getting errors like the following:

6>  opencv_core.dir\Debug\tables.obj
6>     Creating library C:/opencv/build/lib/Debug/opencv_core246d.lib and object C:/opencv    /build/lib/Debug/opencv_core246d.exp
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::copyToWithMask_gpu(struct cv::gpu::PtrStepSz<unsigned char>,struct cv::gpu::PtrStepSz<unsigned char>,unsigned __int64,int,struct cv::gpu::PtrStepSz<unsigned char>,bool,struct CUstream_st *)" (?copyToWithMask_gpu@device@gpu@cv@@YAXU?$PtrStepSz@E@23@0_KH0_NPEAUCUstream_st@@@Z) referenced in function "void __cdecl cv::gpu::copyWithMask(class cv::gpu::GpuMat const &,class cv::gpu::GpuMat &,class cv::gpu::GpuMat const &,struct CUstream_st *)" (?copyWithMask@gpu@cv@@YAXAEBVGpuMat@12@AEAV312@0PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::convert_gpu(struct cv::gpu::PtrStepSz<unsigned char>,int,struct cv::gpu::PtrStepSz<unsigned char>,int,double,double,struct CUstream_st *)" (?convert_gpu@device@gpu@cv@@YAXU?$PtrStepSz@E@23@H0HNNPEAUCUstream_st@@@Z) referenced in function "void __cdecl cv::gpu::convertTo(class cv::gpu::GpuMat const &,class cv::gpu::GpuMat &)" (?convertTo@gpu@cv@@YAXAEBVGpuMat@12@AEAV312@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned char>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned char const *,int,struct CUstream_st *)" (??$set_to_gpu@E@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBEHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@E@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<signed char>(struct cv::gpu::PtrStepSz<unsigned char>,signed char const *,int,struct CUstream_st *)" (??$set_to_gpu@C@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBCHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<signed char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@C@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned short>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned short const *,int,struct CUstream_st *)" (??$set_to_gpu@G@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBGHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@G@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<short>(struct cv::gpu::PtrStepSz<unsigned char>,short const *,int,struct CUstream_st *)" (??$set_to_gpu@F@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBFHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@F@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<int>(struct cv::gpu::PtrStepSz<unsigned char>,int const *,int,struct CUstream_st *)" (??$set_to_gpu@H@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBHHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<int>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@H@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<float>(struct cv::gpu::PtrStepSz<unsigned char>,float const *,int,struct CUstream_st *)" (??$set_to_gpu@M@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBMHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<float>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@M@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<double>(struct cv::gpu::PtrStepSz<unsigned char>,double const *,int,struct CUstream_st *)" (??$set_to_gpu@N@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBNHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<double>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@N@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned char>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned char const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@E@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBE0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@E@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<signed char>(struct cv::gpu::PtrStepSz<unsigned char>,signed char const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@C@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBC0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<signed char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@C@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned short>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned short const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@G@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBG0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@G@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<short>(struct cv::gpu::PtrStepSz<unsigned char>,short const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@F@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBF0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@F@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<int>(struct cv::gpu::PtrStepSz<unsigned char>,int const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@H@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBH0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<int>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@H@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<float>(struct cv::gpu::PtrStepSz<unsigned char>,float const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@M@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBM0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<float>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@M@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<double>(struct cv::gpu::PtrStepSz<unsigned char>,double const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@N@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBN0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<double>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@N@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>C:\opencv\build\bin\Debug\opencv_core246d.dll : fatal error LNK1120: 16 unresolved externals
6>  The command exited with code 1120.
6>Done executing task "Link" -- FAILED.
6>Done building target "Link" in project "opencv_core.vcxproj" -- FAILED.
6>
6>Build FAILED.

Similar errors appear for four other projects.

I am new to CMake, etc., so this may be something simple but I cannot figure it out.

I have done the following:

1) load CUDA 5.5 - seems to load properly and I am able to compile some of the examples;

2) download OpenCV2.4.6;

3) load CMake 2.8.11.2 - set the source dir to c:\opencv, set the build dir to c:\opencv\build\;

4) configure and generate CMake for Visual Studio 11 Win64 - then close;

5) start VS2012 and select the ALL_BUILD solution - build.

I then get these errors. I have done a clean install by completely deleting CUDA, CMake, and OpenCV and then reinstalling them but still no luck.

It seems like VS2012 is not finding CUDA.

What am I doing wrong?

Thanks for any help.

Building OpenCV 2.4.6 with CUDA 5.5RC in VS2012

Has anybody succeeded in building OpenCV 2.4.6. with CUDA 5.5RC in VS2012 c++/cli?

I am running the above in Windows 8 64 bit.

bit. I am bulding in VS2012 with Debug and x64 the configuration. While most of OpenCV builds, five projects will not and I am getting errors like the following:

6>  opencv_core.dir\Debug\tables.obj
6>     Creating library C:/opencv/build/lib/Debug/opencv_core246d.lib and object C:/opencv    /build/lib/Debug/opencv_core246d.exp
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::copyToWithMask_gpu(struct cv::gpu::PtrStepSz<unsigned char>,struct cv::gpu::PtrStepSz<unsigned char>,unsigned __int64,int,struct cv::gpu::PtrStepSz<unsigned char>,bool,struct CUstream_st *)" (?copyToWithMask_gpu@device@gpu@cv@@YAXU?$PtrStepSz@E@23@0_KH0_NPEAUCUstream_st@@@Z) referenced in function "void __cdecl cv::gpu::copyWithMask(class cv::gpu::GpuMat const &,class cv::gpu::GpuMat &,class cv::gpu::GpuMat const &,struct CUstream_st *)" (?copyWithMask@gpu@cv@@YAXAEBVGpuMat@12@AEAV312@0PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::convert_gpu(struct cv::gpu::PtrStepSz<unsigned char>,int,struct cv::gpu::PtrStepSz<unsigned char>,int,double,double,struct CUstream_st *)" (?convert_gpu@device@gpu@cv@@YAXU?$PtrStepSz@E@23@H0HNNPEAUCUstream_st@@@Z) referenced in function "void __cdecl cv::gpu::convertTo(class cv::gpu::GpuMat const &,class cv::gpu::GpuMat &)" (?convertTo@gpu@cv@@YAXAEBVGpuMat@12@AEAV312@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned char>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned char const *,int,struct CUstream_st *)" (??$set_to_gpu@E@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBEHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@E@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<signed char>(struct cv::gpu::PtrStepSz<unsigned char>,signed char const *,int,struct CUstream_st *)" (??$set_to_gpu@C@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBCHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<signed char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@C@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned short>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned short const *,int,struct CUstream_st *)" (??$set_to_gpu@G@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBGHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@G@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<short>(struct cv::gpu::PtrStepSz<unsigned char>,short const *,int,struct CUstream_st *)" (??$set_to_gpu@F@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBFHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@F@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<int>(struct cv::gpu::PtrStepSz<unsigned char>,int const *,int,struct CUstream_st *)" (??$set_to_gpu@H@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBHHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<int>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@H@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<float>(struct cv::gpu::PtrStepSz<unsigned char>,float const *,int,struct CUstream_st *)" (??$set_to_gpu@M@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBMHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<float>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@M@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<double>(struct cv::gpu::PtrStepSz<unsigned char>,double const *,int,struct CUstream_st *)" (??$set_to_gpu@N@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBNHPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<double>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,struct CUstream_st *)" (??$kernelSetCaller@N@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned char>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned char const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@E@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBE0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@E@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<signed char>(struct cv::gpu::PtrStepSz<unsigned char>,signed char const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@C@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBC0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<signed char>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@C@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<unsigned short>(struct cv::gpu::PtrStepSz<unsigned char>,unsigned short const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@G@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBG0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<unsigned short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@G@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<short>(struct cv::gpu::PtrStepSz<unsigned char>,short const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@F@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBF0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<short>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@F@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<int>(struct cv::gpu::PtrStepSz<unsigned char>,int const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@H@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBH0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<int>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@H@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<float>(struct cv::gpu::PtrStepSz<unsigned char>,float const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@M@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBM0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<float>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@M@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>gpumat.obj : error LNK2019: unresolved external symbol "void __cdecl cv::gpu::device::set_to_gpu<double>(struct cv::gpu::PtrStepSz<unsigned char>,double const *,struct cv::gpu::PtrStepSz<unsigned char>,int,struct CUstream_st *)" (??$set_to_gpu@N@device@gpu@cv@@YAXU?$PtrStepSz@E@12@PEBN0HPEAUCUstream_st@@@Z) referenced in function "void __cdecl `anonymous namespace'::kernelSetCaller<double>(class cv::gpu::GpuMat &,class cv::Scalar_<double>,class cv::gpu::GpuMat const &,struct CUstream_st *)" (??$kernelSetCaller@N@?A0xd269b65d@@YAXAEAVGpuMat@gpu@cv@@V?$Scalar_@N@3@AEBV123@PEAUCUstream_st@@@Z)
6>C:\opencv\build\bin\Debug\opencv_core246d.dll : fatal error LNK1120: 16 unresolved externals
6>  The command exited with code 1120.
6>Done executing task "Link" -- FAILED.
6>Done building target "Link" in project "opencv_core.vcxproj" -- FAILED.
6>
6>Build FAILED.

Similar errors appear for four other projects.

I am new to CMake, etc., so this may be something simple but I cannot figure it out.

I have done the following:

1) load CUDA 5.5 - seems to load properly and I am able to compile some of the examples;

2) download OpenCV2.4.6;

3) load CMake 2.8.11.2 - set the source dir to c:\opencv, set the build dir to c:\opencv\build\;

4) configure and generate CMake for Visual Studio 11 Win64 - then close;

5) start VS2012 and select the ALL_BUILD solution - build.

I then get these errors. I have done a clean install by completely deleting CUDA, CMake, and OpenCV and then reinstalling them but still no luck.

It seems like VS2012 is not finding CUDA.

What am I doing wrong?

Thanks for any help.