User`s guide

C Standalone App lication Target
C Standalone Application Target
In this section...
“Compiling the A pplication” on page 6-3
“Testing the Application” on page 6-3
“Deploying the Application” on page 6-6
“Running the Application” on page 6-7
Compiling the Application
This examp le takes an M -file, magicsquare.m, and creates a standalone C
application,
magicsquare.
1 Copy the file magicsq uare .m from
matlabroot/extern/examples/compiler
to your work directory.
2 To compile the M-code, use
mcc -mv magics
quare.m
The -m option tells MATLAB Com pile r (mcc) to generate a C standalone
application. The
-v option (verbose) displays the compilation steps
throughout the process and h elps identify other useful information such
as which third-party compiler is used and w hat environment variables
are referenced.
This command
creates the s tandalone application called
magicsquare and
additional f
iles. The Windows platform appends the
.exe exte nsion to
the name. Se
e the table in “Standalone Executable” on page 3-6 for the
complete li
st of files created.
Testing the
Application
These steps
test your standalone ap pl ication o n you r development machine.
6-3