User`s guide
MATLAB Compiler Generated Interface Functions
MATLAB Compiler Generated Interface Functions
In this section...
“Functions in the Shared Library” on page 7-23
“Type of Application” on page 7-23
“Structure of Programs That Call Shared Libraries” on page 7-25
“Library Initialization and Termination F unctions” on page 7-25
“Print and Error Handling Functions” on page 7 -27
“Functions Generated from M-Files” on page 7 -28
Functions in the Shared Library
A shared library generated by MATLAB Compiler contains at least seven
functions. There are three generated functi on s to manage library initialization
and termination, one each for printed output and error messages, and two
generated functions for each M-file compiled into the library.
To generate the functions described in this section, first copy
sierpinski.m, main_for _lib.c, main_for_lib.h,andtriangle.c from
matlabroot/extern/examples/compi ler into your directory, and then
execute the appropriate MATLAB Compiler command.
Type of Application
For a C Application on Windows
mcc -W lib:libtriangle -T link:lib sierpinski.m
mbuild triangle.c main_for_lib .c libt rian gle.lib
For a C Application on UNIX
mcc -W lib:libtriangle -T link:lib sierpinski.m
mbuild triangle.c main_for_lib .c -L. -ltriang le -I.
7-23