User`s guide
4 Stand-Alone Applications
4-4
The MATLAB Compiler translates input M-files into C source code suitable for
your own stand-alone applications. After compiling this C source code, the
resulting object file is linked with the object libraries.
For more i nformation about which libraries must be included when you
distribute a C application, see “Distributing Stand-Alone UNIX Applications”
on page 4-14 or “Distributing Stand-Alone Windows Applications” on page
4-26.
Note If you attempt to compile M-files to produce stand-alo n e applications
and you do not have the MATLAB C/C++ Math Library installed, the system
will not be able to find the appropriate libraries and the linking will fail. Also,
if you do not have the MATLAB C/C++ Graphics Library installed, the
MATLAB Compiler will generate run-time errors if the graphics functions are
called.
Stand-Alone C++ Applications
To build stand-alone C++ applications, MATLAB, the MATLAB Compiler, a
C++compiler,andtheMATLAB C/C++ MathLibrarymustbe installedonyour
system.
The source code for a stand-alone C++ application consists either entirely of
M-files or some combination of M-files, MEX-files, and C or C++ source code
files.
The MATLAB Compiler, when invoked with the appropriate option flag (
-p or
-L Cpp), translates input M-files into C++ source code suitable for your own
stand-alone applications. After compiling this C++ source code, the resulting
object files are linked against the MATLAB C/C++ Math Library. For more
information about which libraries must be included when you distribute a C ++
application,see “Distributing Stand-Alone UNIX Applications” on page 4-14 or
“Distributing Stand-Alone Windows Applications” on page 4-26.
Note On the PC, the MATLAB C++ Math Library is static because the
different PC compiler vendors use different C++ name mangling algorithms.