Problems with upgrading libs in ofxOpenCv [solved]


#1

Dear oF developers,

I’m working now with OF v0.10.0 on macOS with Xcode 9.4.1. The current version of openCV in ofxOpenCv is 3.1.0. I’d like to use the latest version of OpenCv (3.4.2) for my project, because the object tracking API has changed since version >3.3 and the DNN module has been improved. For that I tried to upgrade the static library and header in ofxOpenCv by doing the following:

cp -R $OPENCV_DIR/include/* $OPENFRAMEWORKS_DIR/addons/ofxOpenCv/libs/opencv/include/

libtool -static $OPENCV_DIR"/lib/lib*.a" -o $OPENFRAMEWORKS_DIR/addons/ofxOpenCv/libs/opencv/lib/osx/opencv.a

However, I get many linker errors. Below are the first ones shown. Does anyone know what I do wrong? I tried both self compiled opencv-3.4.2 and the pre-compiled version from brew.

Undefined symbols for architecture x86_64:
  "_clWaitForEvents", referenced from:
      _clWaitForEvents_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clWaitForEvents_pfn)
  "_clSetKernelArg", referenced from:
      _clSetKernelArg_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clSetKernelArg_pfn)
  "_clSetEventCallback", referenced from:
      _clSetEventCallback_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clSetEventCallback_pfn)
  "_clReleaseContext", referenced from:
      _clReleaseContext_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clReleaseContext_pfn)
  "_clGetProgramInfo", referenced from:
      _clGetProgramInfo_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clGetProgramInfo_pfn)
  "_clGetPlatformInfo", referenced from:
      _clGetPlatformInfo_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clGetPlatformInfo_pfn)
  "_clGetPlatformIDs", referenced from:
      _clGetPlatformIDs_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clGetPlatformIDs_pfn)
  "_clGetKernelWorkGroupInfo", referenced from:
      _clGetKernelWorkGroupInfo_pfn in libopencv_core.a(opencl_core.cpp.o)
     (maybe you meant: _clGetKernelWorkGroupInfo_pfn)
...

#2

Looks like openCL related error.
Have you tried adding openCL framework?


#3

That solved the problem. Thank you so much!!!