Ask Your Question
1

Building OpenCV 2.4.6 with CUDA 5.5RC in VS2012

asked 2013-08-02 23:41:58 -0500

pistorinoj gravatar image

updated 2013-08-03 00:03:25 -0500

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. 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 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
3

answered 2013-08-03 09:40:43 -0500

Vladislav Vinogradov gravatar image

Set CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE CMake variable to OFF.

edit flag offensive delete link more

Comments

I can't see where to make that change. It is not one of the options in CMake that I see. Also, I notice that CUDA is not listed as one of the selectable folders in the Project Properties and it seems like it was before.

pistorinoj gravatar imagepistorinoj ( 2013-08-03 10:02:54 -0500 )edit

It is 'advanced' option. Click on checkbox advanced in CMake GUI.

Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2013-08-03 13:11:28 -0500 )edit

That was definitely it. Thanks.

pistorinoj gravatar imagepistorinoj ( 2013-08-03 15:00:53 -0500 )edit

I can't find a CMakeLists.txt in my opencv directory... where did you find it? I've downloaded this file http://sourceforge.net/projects/opencvlibrary/

Nicola17 gravatar imageNicola17 ( 2013-08-05 02:38:45 -0500 )edit

did you succeed in building the source code ? ,,, i have same problems

attia gravatar imageattia ( 2013-09-15 17:40:47 -0500 )edit

Yes. I just followed everything above. Vladislav's comment directed me to where to set the right CMake setting.

pistorinoj gravatar imagepistorinoj ( 2013-09-26 09:11:34 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2013-08-02 23:41:58 -0500

Seen: 2,725 times

Last updated: Aug 03 '13