Re: error message while compiling engdemo.c



"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
.



Relevant Pages

  • error message while compiling engdemo.c
    ... 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:: undefined reference to `engPutVariable' ... engdemo.c:: undefined reference to `engEvalString' ...
    (comp.soft-sys.matlab)
  • error message while compiling engdemo.c
    ... 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:: undefined reference to `engPutVariable' ... engdemo.c:: undefined reference to `engEvalString' ...
    (comp.soft-sys.matlab)
  • error message while compiling engdemo.c
    ... 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:: undefined reference to `engPutVariable' ... engdemo.c:: undefined reference to `engEvalString' ...
    (comp.soft-sys.matlab)
  • g77 and fftw linker(?) problem
    ... I am trying to use the fftw routines in a fortran 77 program. ... When I compile the program with the following: ... /tmp/ccOPvtdD.o: undefined reference to ...
    (comp.lang.fortran)
  • Re: reading more data than the record size (RECL)
    ... end snip ... This overhead is there to allow Fortran ... compile the original source code with g95, ... Think of it as a variant on the ASCII vrs ...
    (comp.lang.fortran)