Search code examples
c++opencvlinkertracker

OpenCV 3.0 Linker errors in tracker example


I am trying to build and run the tracker example from here.

I have compiled OpenCV 3.0 from source and the extra contrib-repo without any problems (all in VS2013). I've set up a new project set the directories appropriately and tried to build it. I've added the following lib files (and tried many others which do nothing):

  • opencv_core300d.lib
  • opencv_video300d.lib
  • opencv_videoio300d.lib
  • opencv_tracking300d.lib
  • opencv_highgui300d.lib

I still get the following 2 linker errors:

Error   1   error LNK2019: unresolved external symbol "void __cdecl cv::rectangle(class cv::_InputOutputArray const &,class cv::Point_<int>,class cv::Point_<int>,class cv::Scalar_<double> const &,int,int,int)" (?rectangle@cv@@YAXABV_InputOutputArray@1@V?$Point_@H@1@1ABV?$Scalar_@N@1@HHH@Z) referenced in function "void __cdecl onMouse(int,int,int,int,void *)" (?onMouse@@YAXHHHHPAX@Z)   D:\Work\ProFit\TLD\test project\Test project\Test project\Source.obj    Test project

Error   2   error LNK2019: unresolved external symbol "void __cdecl cv::rectangle(class cv::Mat &,class cv::Rect_<int>,class cv::Scalar_<double> const &,int,int,int)" (?rectangle@cv@@YAXAAVMat@1@V?$Rect_@H@1@ABV?$Scalar_@N@1@HHH@Z) referenced in function _main    D:\Work\ProFit\TLD\test project\Test project\Test project\Source.obj    Test project

What am I doing wrong? Everything I search for suggests the cv::rectangle should be contained in the core library file!

Thanks


Solution

  • Easy solution, as pointed out by Berak, the core functionality was in imgproc. Adding opencv_imgproc300d.lib to the project sorted it!