I am trying to build this sample opencv application with visual studio 2012:
https://github.com/Itseez/opencv/blob/2.4/samples/ocl/surf_matcher.cpp
To do this, I download and install opencv 2.4.6 and installed it on my system.
Configured visual studio 2012 to use it (set include path, library path and libraries)
I checked and I added all libraries in opencv\build\x86\vc11\staticlib to my application (I take care that debug libraries were added to debug build and release libraries to release build).
I am compiling the code, I am getting several link error:
Error 1 error LNK2019: unresolved external symbol "public: __thiscall cv::ocl::SURF_OCL::SURF_OCL(double,int,int,bool,float,bool)" (??0SURF_OCL@ocl@cv@@QAE@NHH_NM0@Z) referenced in function "public: __thiscall `anonymous namespace'::SURFDetector<class cv::ocl::SURF_OCL>::SURFDetector<class cv::ocl::SURF_OCL>(double)" (??0?$SURFDetector@VSURF_OCL@ocl@cv@@@?A0x1f01e08d@@QAE@N@Z)
Error 7 error LNK2001: unresolved external symbol _clReleaseMemObject@4 ConsoleApplication1\opencv_ocl246d.lib(arithm.obj)
There are several of them and all of them seems related to ocl library.
Which other library should I add for OCL to work?
Note:
When I tried to compile, I got the following error:
'getDeviceInfo' : is not a member of 'cv::ocl::Context'
on this code:
if(!useCPU)
{
std::cout
<< "Device name:"
<< cv::ocl::Context::getContext()->getDeviceInfo().deviceName
<< std::endl;
}
This error seems relates to different ocl.hpp which is around. I used the github version (See answers for detail) and after changing the header that it needs, compile error solved.