Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Calling MATLAB from C
Date: Mon, 28 Jul 2008 17:39:02 +0000 (UTC)
Organization: Concordia University
Lines: 37
Message-ID: <g6l07m$atu$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1217266742 11198 172.30.248.37 (28 Jul 2008 17:39:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 28 Jul 2008 17:39:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1378035
Xref: news.mathworks.com comp.soft-sys.matlab:482268



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