Skip to content Skip to sidebar Skip to footer

OpenCV Undefined References

I'm trying to link my JNI Android application with OpenCV but I get these errors ./obj/local/armeabi /libopencv_calib3d.a(calibinit.cpp.o): In function `cvDrawChessboardCorners': c

Solution 1:

The problem was in the libraries order. The correct order is:

LOCAL_STATIC_LIBRARIES :=  libopencv_calib3d opencv_features2d opencv_flann opencv_imgproc opencv_core

So the main principle is you have to declare libraries in reverse order of their dependency (e.g. *opencv_imgproc* depends on *opencv_core* and *opencv_features2d* depends on *opencv_imgproc* and so on).


Solution 2:

You are missing opencv_highgui and probably opencv_features2d as well.

cv::rectangle is defined at opencv_core.

Make sure that your file is being linked with all these libraries.


Solution 3:

You can also look at the output of pkg-config --static --libs opencv to arrange the libraries in the correct order.


Post a Comment for "OpenCV Undefined References"