Build a tracker with open cv,clapack and visual studio 2015 [closed]
Hi I am trying to run the code of a visual object tracker that is written in c/c++ and is advised to configure using opencv 2.1 and lapack .however I am trying to run the code using visual studio 2015 ,open cv 3.0 or 3.1 inside visual studio with clapack. Below are the errors i am getting.
Error LNK2019 unresolved external symbol _dpotrf_ referenced in function _main tracker
Error LNK2019 unresolved external symbol _dgeqrf_ referenced in function _main tracker
Error LNK2019 unresolved external symbol _dorgqr_ referenced in function _main tracker
Now i think it is due to name mangling as the _ underscore before the function is shown ,but the thing is clapack.h file has the function declared using extern c . i have used all the necessary libraries and include folder to best of my knowledge.Any help would be greatly appreciated
Thank you
I think that's not an opencv problem but a linker problem. You have to give path to lapack lib in visual studio as dpotrf seems to be a lapck function.
I know it is a clapack function . but didn't find answer any where so i asked here .just in case some one might have run into the similar problem and have found a solution
have you path to clapack lib to linker?
yes i have added blasd.lib lapackd.lib and libf2cd.lib in linker, additional library directories but still getting the same error
Is your source code available on github?
It is available on this site http://cv.snu.ac.kr/jhkwon/PAMI14_tra... .a geometric particle filter for template based visual tracking
grossly outdated code, unfortunately. i would not try too hard with that, but rather look for an alternative.
@berak thank you for looking at the code but it is not a solution .your comment only teaches that whenever there is a problem look for an easy way out . beside this i don't have any alternative option
@anony, it was just meant as a warning. since it is deprecated c-api all the way down, it will be hard to understand, maintain or fix.
Did you write an extern "C" declaration for the functions (from lapack) you used in your program, such as:
As tuannth said you have to replace in file clapack.h all
by
After don't forget to give path to lapack.lib libf2c.lib and blas.lib in your project
maybe you can get around the name-mangling like this:
@LBerger the libraries are already in the project path the only thing left is extern "c".i will recompile the clapack project and get back to you . @berak i had already tried this in my own code and was getting the same error .thanks @tuannhtn .
I have some experience with lapack when using it with OpenCV. In fact, you don't have to recompile the clapack project, just adding some external declarations of the functions you used in your program. In my case, I compiled lapack with GCC (using msys and mingw on Windows) and then used it with OpenCV in Visual Studio.