Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors (Ubuntu, MatLAB) #55

Open
GerardWalsh opened this issue Feb 9, 2017 · 1 comment
Open

Compile errors (Ubuntu, MatLAB) #55

GerardWalsh opened this issue Feb 9, 2017 · 1 comment

Comments

@GerardWalsh
Copy link

Hi there. I'm trying to run the TLD algorithm on Ubuntu 16.04 (64-bit) and MatLAB R2016b

I have not installed openCV, but rather the libraries as stated in the installation guide by

sudo apt-get install libcv-dev

When running compile.m from within MatLAB I get the error (s)

Error using mex
/tmp/mex_12399154940837_20301/lk.o: In function normCrossCorrelation(_IplImage*, _IplImage*, CvPoint2D32f*, CvPoint2D32f*, int, char*, float*, int, int)': lk.cpp:(.text+0x1a0): undefined reference to cvCreateImage'
lk.cpp:(.text+0x1b9): undefined reference to cvCreateImage' lk.cpp:(.text+0x1d6): undefined reference to cvCreateImage'
lk.cpp:(.text+0x214): undefined reference to cvGetRectSubPix' lk.cpp:(.text+0x227): undefined reference to cvGetRectSubPix'
lk.cpp:(.text+0x23b): undefined reference to cvMatchTemplate' lk.cpp:(.text+0x274): undefined reference to cvReleaseImage'
lk.cpp:(.text+0x27d): undefined reference to cvReleaseImage' lk.cpp:(.text+0x286): undefined reference to cvReleaseImage'
/tmp/mex_12399154940837_20301/lk.o: In function mexFunction': lk.cpp:(.text+0x323): undefined reference to cvReleaseImage'
lk.cpp:(.text+0x341): undefined reference to cvReleaseImage' lk.cpp:(.text+0x438): undefined reference to cvCreateImage'
lk.cpp:(.text+0x455): undefined reference to cvCreateImage' lk.cpp:(.text+0x4be): undefined reference to cvCreateImage'
lk.cpp:(.text+0x4dc): undefined reference to cvCreateImage' lk.cpp:(.text+0x553): undefined reference to cvAlloc'
lk.cpp:(.text+0x565): undefined reference to cvAlloc' lk.cpp:(.text+0x578): undefined reference to cvAlloc'
lk.cpp:(.text+0x613): undefined reference to cvAlloc' lk.cpp:(.text+0x61e): undefined reference to cvAlloc'
/tmp/mex_12399154940837_20301/lk.o:lk.cpp:(.text+0x626): more undefined references to cvAlloc' follow /tmp/mex_12399154940837_20301/lk.o: In function mexFunction':
lk.cpp:(.text+0x6c1): undefined reference to cvCalcOpticalFlowPyrLK' lk.cpp:(.text+0x73e): undefined reference to cvCalcOpticalFlowPyrLK'
collect2: error: ld returned 1 exit status

Error in compile (line 77)
eval(['mex lk.cpp -O' include lib]);

I have implemented the changes to the files as in Schloegl's pull request and thought this would sort out the error (s) I thought there were between linking MatLAB and OpenCV's libraries

Thanks
Gerard

@fabiovii
Copy link

Hi,

I have the very same problem of @gerrywalsh when executing the line:

eval(['mex lk.cpp -O' include lib]);

However, if I run the command with the -c option (which means "Compiles an object file only. Does not build a binary MEX file.") compilation end successfully (but then "run_TLD.m" fails with "Undefined function or variable 'lk' since the associated mex does not exist I believe" )

I tried also to link to version 2.4 of opencv but the same error occurs.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants