Thread Subject: Calling MATLAB from C

Subject: Calling MATLAB from C

From: Arpita

Date: 28 Jul, 2008 17:39:02

Message: 1 of 1

My main aim is to call MATLAB engine from a C program. do
some computation in MATLAB and return back the result to the
C program. But just at the start i am facing a problem.

I am using MATLAB R14 SP3 in Linux.
I cud not run the example engdemo.c from command prompt!! i
had changed the #include "engine.h" to point to the same
file in the include directory. after trying to compile the
example, i run into the following error:


[root@narmada etc]# gcc engdemo.c -o engdemo
/tmp/ccsXH5nc.o: In function `main':
engdemo.c:(.text+0x4a): undefined reference to `engOpen'
engdemo.c:(.text+0xa3): undefined reference to
`mxCreateDoubleMatrix'
engdemo.c:(.text+0xb1): undefined reference to `mxGetPr'
engdemo.c:(.text+0xe8): undefined reference to `engPutVariable'
engdemo.c:(.text+0xfb): undefined reference to `engEvalString'
engdemo.c:(.text+0x10e): undefined reference to `engEvalString'
engdemo.c:(.text+0x121): undefined reference to `engEvalString'
engdemo.c:(.text+0x134): undefined reference to `engEvalString'

etc..........



I tried to solve it on my own, bt in vain.
i come to know that theres a linking problem, bt how to
solve it?

Please help me if you can !!
Please !!!


Thanking You
Arpita

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
engine Ryan Ollos 11 Mar, 2009 22:01:31
engdemoc Arpita 28 Jul, 2008 13:40:25
matlab Arpita 28 Jul, 2008 13:40:25
c Arpita 28 Jul, 2008 13:40:25
rssFeed for this Thread

Contact us at files@mathworks.com