Re: error message while compiling engdemo.c
- From: "James Tursa" <aclassyguy_with_a_k_not_a_c@xxxxxxxxxxx>
- Date: Thu, 21 Jan 2010 16:10:19 +0000 (UTC)
"delage stephanie" <stephanie.delage@xxxxxxxxxxx> wrote in message <hj9t58$5go$1@xxxxxxxxxxxxxxxxxx>...
Hello, I need to compile a fortran program which calls matlab functions.
As I have never done it before, I try to compile examples given on the matlab documentation: engdemo.c and fengdemo.f.
When I try to compile engdemo.c (with the command mex engdemo.c), I have the following error message:
===================================
engdemo.o: In function `main':
engdemo.c:(.text+0xdb): undefined reference to `engOpen'
engdemo.c:(.text+0x1ab): undefined reference to `engPutVariable'
engdemo.c:(.text+0x1ba): undefined reference to `engEvalString'
engdemo.c:(.text+0x1c9): undefined reference to `engEvalString'
engdemo.c:(.text+0x1d8): undefined reference to `engEvalString'
engdemo.c:(.text+0x1e7): undefined reference to `engEvalString'
engdemo.c:(.text+0x1f6): undefined reference to `engEvalString'
engdemo.o:engdemo.c:(.text+0x234): more undefined references to `engEvalString' follow
engdemo.o: In function `main':
engdemo.c:(.text+0x248): undefined reference to `engOutputBuffer'
engdemo.c:(.text+0x2b9): undefined reference to `engEvalString'
engdemo.c:(.text+0x2e8): undefined reference to `engGetVariable'
engdemo.c:(.text+0x339): undefined reference to `engClose'
collect2: ld returned 1 exit status
mex: link of ' "engdemo.mexa64"' failed.
==================================
Can someone help me?
To compile engdemo.c, do the following:
Copy the engdemo.c file to your working directory.
Make the working directory your current directory.
Issue the following commands:
mex -setup
(then follow the prompts to select the lcc compiler)
options = [matlabroot '\bin\win32\mexopts\lccengmatopts.bat'];
mex('-f', options, 'engdemo.c');
Then you can run it with the bang operator:
!engdemo
For Fortran, follow similar steps as above but select the Fortran compiler and use the appropriate Fortran engmatopts.bat file. You will need your own Fortran compiler installed since MATLAB does not supply one.
James Tursa
.
- Follow-Ups:
- Re: error message while compiling engdemo.c
- From: delage stephanie
- Re: error message while compiling engdemo.c
- References:
- error message while compiling engdemo.c
- From: delage stephanie
- error message while compiling engdemo.c
- Prev by Date: Re: click on a plotted line to change properties in gui
- Next by Date: Re: QT clustering implementation/details?
- Previous by thread: error message while compiling engdemo.c
- Next by thread: Re: error message while compiling engdemo.c
- Index(es):
Relevant Pages
|