Ask Your Question
0

undefined reference to `cv::ocl::initializeContextFromHandle(cv::ocl::Context&, void*, void*, void*)'

asked 2018-01-29 05:30:28 -0600

arpu gravatar image

updated 2018-01-29 05:41:17 -0600

System information (version) OpenCV => 3.4.0 Operating System / Platform => ubuntu lts 16.04 64 Bit Compiler => g++ 5.4.0 Detailed description on linking i get undefined reference to `cv::ocl::initializeContextFromHandle(cv::ocl::Context&, void, void, void*)'

Steps to reproduce g++ -std=c++11 -std=gnu++11 -Wall -std=c++11 test.cpp -I/usr/local/include -I/opt/rocm/include/ -lOpenCL -lopencv_core -lopencv_imgproc -lopencv_imgcodecs

anything i missing?

opencv cmake output http://lpaste.net/8634527317583986688

edit retag flag offensive close merge delete

Comments

probably unrelated, but : g++ -std=c++11 -std=gnu++11 please use either c++11 or gnu++11, not both.

how comes, you explicitly link -lOpenCL ? may we see your cmake output ?

berak gravatar imageberak ( 2018-01-29 05:34:23 -0600 )edit
1

add the cmake opencv output OpenCL is needed for
cl_int cl_context cl_mem

arpu gravatar imagearpu ( 2018-01-29 05:42:23 -0600 )edit

so, you're writing your own opencl code ?

at least try once with a minimal opencv program without that (empty main() or such) and without -lOpenCL

berak gravatar imageberak ( 2018-01-29 05:56:46 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-01-29 08:56:18 -0600

arpu gravatar image

ok found the problem the sysmbol is not exported as alalek suggested on github

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-01-29 05:30:28 -0600

Seen: 334 times

Last updated: Jan 29 '18