User`s guide
C Shared Library Target
Note This command assumes that the shared library and the corresponding
header file created from step 2 are in the current working directory.
On UNIX, if this is not the case, replace the “
.” (dot) following the -L and -I
options with the name of the directory that contains these files, re spectiv ely.
On Windows, if this is not the case, specify the full path to
libmatrix.lib,
and use a
-I option to specify the directory co ntaining t he header file.
This generates a standalone application, matrixdriver.ex e,onWindows,
and
matrixdriver, on UNIX.
Difference in the Exported Function Signature. The interface to the
mlf
functions generated by MATLAB C ompiler from your M-file routines has
changed from earlier versions of MATLAB Compiler. The generic signature of
the exported
mlf functions is
• M-functions with no return values
void mlf<function-name >(<l ist_of_input_variab les>);
• M-functions with at least one return va l ue
void mlf<function-name >(in t numbe r_of _return_values,
<list_of_pointers_to_return_variab les>,
<list_of_input_variables>);
Refer to the header file generated for your library for the exact signature of
the exported f unction. For example, in the library created in the previous
section, the signature of the exported addmatrix function is
void mlfAddmatrix(int nlhs,mx Array **a,mxArray *a1,mxArray *a2);
Testing the Driver Application
These steps test your standalone driver application and shared library on
your development machine.
7-7