User`s guide
4 Stand-Alone Applications
4-36
To compile and link all four C source code files (main.c, rank.c, mrank.c,and
main_main.c) into a stand-alone application, use
mcc -m main_main.c main.c rank.c mrank.c
The resulting stand-alone application uses your customized version of mlfRank
rather than the default version of mlfRank stored in the MATLAB Toolbox
Library.
Note On PCs running Windows, as well as SGI, SGI64, and IBM, if a
function in the MATLAB Toolbox Library calls
mlfRank, it will call the one
found in the Library and not your customized version. We recommend that
you call your version of rank something else, for example, myrank.m.
Compiling mrank.m and rank.m as Helper
Functions
Anotherway ofbuilding themrank stand-alon e ap pl icat ion is to compile rank.m
and mrank.m as helper functions to main.m. In other words, instead of invoking
the MATLAB Compiler three separate times, invoke the MATLAB Compiler
only once. For C
mcc -m main rank
For C++
mcc -p main rank
These commands create files containing the C or C++ source code. The macro
options
-m and -p automatically compile all helper functions.