Ask Your Question
0

Compile OpenCV 245 for Win7 x64 with MSVC 2010 (x86) and CUDA

asked 2013-06-28 12:55:55 -0600

nikkadim gravatar image

Could you please advice. My build is successful except error below, looks like OpenCL library is missing, right?

3>Link:
3>     Creating library C:/Users/nikolay/Downloads/opencv/mybuild/lib/Release/opencv_ocl245.lib and object C:/Users/nikolay/Downloads/opencv/mybuild/lib/Release/opencv_ocl245.exp
3>matrix_operations.obj : error LNK2001: unresolved external symbol _clReleaseMemObject@4
3>mcwutil.obj : error LNK2001: unresolved external symbol _clReleaseMemObject@4
3>arithm.obj : error LNK2019: unresolved external symbol _clReleaseMemObject@4 referenced in function "int __cdecl cv::ocl::countNonZero(class cv::ocl::oclMat const &)" (?countNonZero@ocl@cv@@YAHABVoclMat@12@@Z)
3>haar.obj : error LNK2001: unresolved external symbol _clReleaseMemObject@4
3>imgproc.obj : error LNK2001: unresolved external symbol _clReleaseMemObject@4
3>initialization.obj : error LNK2001: unresolved external symbol _clReleaseMemObject@4
3>mcwutil.obj : error LNK2001: unresolved external symbol _clCreateBuffer@24
3>canny.obj : error LNK2019: unresolved external symbol _clCreateBuffer@24 referenced in function "public: void __thiscall cv::ocl::CannyBuf::create(class cv::Size_<int> const &,int)" (?create@CannyBuf@ocl@cv@@QAEXABV?$Size_@H@3@H@Z)
3>imgproc.obj : error LNK2001: unresolved external symbol _clCreateBuffer@24
3>initialization.obj : error LNK2001: unresolved external symbol _clCreateBuffer@24
3>matrix_operations.obj : error LNK2001: unresolved external symbol _clCreateBuffer@24
3>canny.obj : error LNK2019: unresolved external symbol _clEnqueueWriteBuffer@36 referenced in function "void __cdecl cv::ocl::canny::edgesHysteresisGlobal_gpu(class cv::ocl::oclMat &,class cv::ocl::oclMat &,class cv::ocl::oclMat &,void *,int,int)" (?edgesHysteresisGlobal_gpu@canny@ocl@cv@@YAXAAVoclMat@23@00PAXHH@Z)
3>haar.obj : error LNK2001: unresolved external symbol _clEnqueueWriteBuffer@36
3>imgproc.obj : error LNK2001: unresolved external symbol _clEnqueueWriteBuffer@36
3>initialization.obj : error LNK2001: unresolved external symbol _clEnqueueWriteBuffer@36
3>canny.obj : error LNK2019: unresolved external symbol _clEnqueueReadBuffer@36 referenced in function "void __cdecl cv::ocl::canny::edgesHysteresisGlobal_gpu(class cv::ocl::oclMat &,class cv::ocl::oclMat &,class cv::ocl::oclMat &,void *,int,int)" (?edgesHysteresisGlobal_gpu@canny@ocl@cv@@YAXAAVoclMat@23@00PAXHH@Z)
3>initialization.obj : error LNK2001: unresolved external symbol _clEnqueueReadBuffer@36
3>haar.obj : error LNK2019: unresolved external symbol _clEnqueueUnmapMemObject@24 referenced in function "public: struct CvSeq * __thiscall cv::ocl::OclCascadeClassifier::oclHaarDetectObjects(class cv::ocl::oclMat &,struct CvMemStorage *,double,int,int,struct CvSize,struct CvSize)" (?oclHaarDetectObjects@OclCascadeClassifier@ocl@cv@@QAEPAUCvSeq@@AAVoclMat@23@PAUCvMemStorage@@NHHUCvSize@@2@Z)
3>haar.obj : error LNK2019: unresolved external symbol _clEnqueueMapBuffer@44 referenced in function "public: struct CvSeq * __thiscall cv::ocl::OclCascadeClassifier::oclHaarDetectObjects(class cv::ocl::oclMat &,struct CvMemStorage *,double,int,int,struct CvSize,struct CvSize)" (?oclHaarDetectObjects@OclCascadeClassifier@ocl@cv@@QAEPAUCvSeq@@AAVoclMat@23@PAUCvMemStorage@@NHHUCvSize@@2@Z)
3>initialization.obj : error LNK2019: unresolved external symbol _clReleaseContext@4 referenced in function "private: void __thiscall cv::ocl::Info::Impl::releaseResources(void)" (?releaseResources@Impl@Info@ocl@cv@@AAEXXZ)
3>initialization.obj : error LNK2019: unresolved external symbol _clReleaseCommandQueue@4 referenced in function "private: void __thiscall cv::ocl::Info::Impl::releaseResources(void)" (?releaseResources@Impl@Info@ocl@cv@@AAEXXZ)
3>initialization.obj : error LNK2019: unresolved external symbol _clEnqueueReadBufferRect@56 referenced in function "void __cdecl cv::ocl::openCLMemcpy2D(class cv::ocl::Context *,void *,unsigned int,void const *,unsigned int,unsigned ...
(more)
edit retag flag offensive close merge delete

Comments

Open 'Properties' panel of opencv_ocl project. Under 'Linker'->Additional Dependencies, add the path to the 32-bit version of OpenCL.lib. On my machine, it is located at "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\x64\OpenCL.lib".

curryage gravatar imagecurryage ( 2013-07-26 16:13:33 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2013-07-26 16:14:35 -0600

curryage gravatar image

updated 2013-07-26 16:15:00 -0600

Open 'Properties' panel of opencv_ocl project. Under 'Linker'->Additional Dependencies, add the path to the 32-bit version of OpenCL.lib. On my machine, it is located at "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\Win32\OpenCL.lib". Re-compile opencv_ocl and the above errors should disappear.

edit flag offensive delete link more
0

answered 2013-07-07 02:15:45 -0600

Nikkadim,

I have the same problem....and it occurred with both dynamic (dll) and static (lib) libraries regardless of what I tried so far.

edit flag offensive delete link more
0

answered 2013-07-25 08:35:29 -0600

decision gravatar image

Has cmake detected your opencl SDK installation? It appears that opencl symbols are missing. Either the compiler command leaves the libraries out for some reason, or the path is not set correctly. (Of course, there can be even other reasons.) I'd look for the cmake configuration summary. In cmake gui, you can also check if opencl sdk paths are set correctly.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-06-28 12:55:55 -0600

Seen: 1,357 times

Last updated: Jul 26 '13