Error while compiling OpenTLD compile.m
freakbird opened this issue · comments
I am trying to compile the mex files needed to run OpenTLD project.
Link : https://github.com/zk00006/OpenTLD
Using:
OpenCV 2.4.9 64-bit, Matlab 2013b 64-bit
When trying to run compile.m, I get the following error.
Creating library C:\Users\Saurabh\AppData\Local\Temp\mex_sT0LV8\templib.x and object C:\Users\Saurabh\AppData\Local\Temp\mex_sT0LV8\templib.exp
lk.obj : error LNK2019: unresolved external symbol cvAlloc referenced in function mexFunction
lk.obj : error LNK2019: unresolved external symbol cvCreateImage referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)
lk.obj : error LNK2019: unresolved external symbol cvReleaseImage referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)
lk.obj : error LNK2019: unresolved external symbol cvGetRectSubPix referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)
lk.obj : error LNK2019: unresolved external symbol cvMatchTemplate referenced in function "void __cdecl normCrossCorrelation(struct _IplImage *,struct _IplImage *,struct CvPoint2D32f *,struct CvPoint2D32f *,int,char *,float *,int,int)" (?normCrossCorrelation@@YAXPEAU_IplImage@@0PEAUCvPoint2D32f@@1HPEADPEAMHH@Z)
lk.obj : error LNK2019: unresolved external symbol cvCalcOpticalFlowPyrLK referenced in function mexFunction
lk.mexw64 : fatal error LNK1120: 6 unresolved externals
C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Link of 'lk.mexw64' failed.
Unable to complete successfully.
Error in compile (line 32)
eval(['mex lk.cpp -O' include lib]);
I know it has something to do with using wrong bit version(32/64) of one of the OpenCV or Matlab to build, but still can't resolve the issue.