【记录一个问题】opencv + cuda编译release版本后,链接出现奇怪的符号
链接出现以下信息:
1 /home/admin/opencv/20190610_cuda_release/lib64/libopencv_core.a(ocl.cpp.o): In function `cv::ocl::Context::Impl::svmInit()': 2 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x133): undefined reference to `clSVMAlloc_pfn' 3 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x16e): undefined reference to `clEnqueueSVMMap_pfn' 4 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x1aa): undefined reference to `clEnqueueSVMUnmap_pfn' 5 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x1dd): undefined reference to `clSVMFree_pfn' 6 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x204): undefined reference to `clSetKernelArgSVMPointer_pfn' 7 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x215): undefined reference to `clEnqueueSVMMemcpy_pfn' 8 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x226): undefined reference to `clEnqueueSVMMemFill_pfn' 9 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x237): undefined reference to `clEnqueueSVMMap_pfn' 10 ocl.cpp:(.text._ZN2cv3ocl7Context4Impl7svmInitEv[_ZN2cv3ocl7Context4Impl7svmInitEv]+0x4b7): undefined reference to `clSVMFree_pfn' 11 collect2: error: ld returned 1 exit status 12 make[2]: *** [test_kcf] Error 1 13 make[1]: *** [CMakeFiles/test_kcf.dir/all] Error 2 14 make: *** [all] Error 2
_pfn的后缀,其实是define出来的应该不能算是一个符号!
说明编译的时候把宏当成了一个符号……
未解决!
=========================
重新编译opencv, 将WITH_OPENCL的所有选项关闭。
重新编译链接程序,解决!