Question

I am using OpenCV-2.4.0 with NetBeans 7.0.1 on Ubuntu 11.10. The following call:

intLeftTriangleIndexImage=cv::Mat::zeros(fpInput.iRows, fpInput.iColumns, CV_32S);

results in

undefined reference to `cv::Mat::zeros(int, int, int)

There appears to be only one library directory for OpenCV-2.4.0, to wit

OpenCV-2.4.0/release/lib/

and I have linked to all of the libraries therein. I do not understand why I am getting a link error for what seems like a very basic call.

Many thanks in advance for any assistance in this matter,
Peter.

Was it helpful?

Solution

That function is defined inside libopencv_core.so, so make sure you are linking to opencv_core.

$ nm libopencv_core.so | c++filt | grep zeros
000db520 T cv::Mat::zeros(cv::Size_<int>, int)
000db330 T cv::Mat::zeros(int, int, int)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top