Matlab Engine Error while using from Linux

조회 수: 6 (최근 30일)
Debjit Pal
Debjit Pal 2013년 3월 25일
Hi,
I am Debjit. I am trying to call Matlab Engine from C Program. I am using Matlab R2011a x86-64 bit version. I failed and I tried with the engdemo.c file included in the Matlab distribution. I tried to compile that with the following gcc command :
gcc engdemo.c -o engdemo.o -I$MATLABROOT/extern/include -L$MATLABROOT/bin/glnxa64 -leng -lmat -lmx -lut
But I got the error message as attached. Can you kindly suggest me what I am missing? I am using gcc version Red Hat 4.4.6-4. The following link contains the error message. http://web.engr.illinois.edu/~dpal2/MatlabError.txt. My final aim is to use the Statistical Toolbox of Matlab using Matlab Engine. looking eagerly for your suggestions.
Thanks and Regards,
Debjit.
  댓글 수: 2
Debjit Pal
Debjit Pal 2013년 3월 26일
Please suggest anyone something... I am still not able to compile.. Thanks in advance for your kind support.
Friedrich
Friedrich 2013년 3월 26일
If you check the verbose mode of mex -v you will see a lot of flags which you need. For the linking stage you need the -rpath and the libraries (-lmx -lmex etc.)
That should resolve the issue. Regards Friedrich

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 3월 25일
Is the shell variable MATLABROOT defined in your shell? If not then it is going to be replaced by the empty string. You would need to define it in the shell as the path that MATLAB is installed into. For example,
export MATLABROOT=/opt/software/matlab/matlabR2012b
but set as appropriate.
  댓글 수: 1
Debjit Pal
Debjit Pal 2013년 3월 25일
Hi Walter,
It is defined in my .bashrc and echo $MATLABROOT shows that correctly. I am clueless.
Debjit.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by