Trouble with KNearest (OpenCV 3.1, Qt, MinGW) [closed]

asked 2017-11-17 07:00:51 -0500

iks5 gravatar image

I've built OpenCV via minGW, it's built correctly, everything was okay. When I created test project, it was okay too - building, compilation, work, everything was good. But when I tried to use KNearest model in my project, I've got building error - undefined reference to cv::ml::KNearest::create(). Of course, I included "ml.hpp" file That's how I created KNearest - cv::Ptr<cv::ml::KNearest> knn = cv::ml::KNearest::create(); Does somebody knows how to fix it?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2017-11-17 08:30:29.653707

Comments

did you link opencv_ml310 ?

berak gravatar imageberak ( 2017-11-17 07:03:53 -0500 )edit

Damn, it was a very stupid mistake, you're right. Thank you so much. I mean, I forgot that lib:)

iks5 gravatar imageiks5 ( 2017-11-17 07:18:20 -0500 )edit