Im compiling below code snippet
cv::Mat frame ;
tld->processImage(frame);
and Getting following linker error
error LNK2019: unresolved external symbol “public: void __thiscall tld::TLD::processImage(class cv::Mat)” (?processImage@TLD@tld@@QAEXVMat@cv@@@Z) referenced in function _main
Now I have changed the code to something like this
Mat frame ;
tld->processImage(0);
and Getting below linker error
error C2664: ‘tld::TLD::processImage’ : cannot convert parameter 1 from ‘int’ to ‘cv::Mat’
No constructor could take the source type, or constructor overload resolution was ambiguous
The problem is when I call the method tld->processImage(frame) Im getting this linker error “unresolved symbol” but when I call this method with incorrect type as parameter it gives another “cannot convert parameter” error thus acknowledging the fact that method is there.
This problem occurs only with the processImage() method.
Im able to call other methods of “tld” without any problem.
Any help is appreciated.
Thanks
I think you’re most likely missing a reference for
cv::Mat. If the TLD class is working elsewhere it is almost certainly because you don’t have an include forcvin the place you’re making this method call.If you have multiple includes for
cvyou should add to the top of the header file;And at the bottom of the file add;
This will ensure that file is only compiled once, and used to solve a lot of linker problems for me when I wrote c++ often.