User`s guide

Building Stand-Alone Applications on UNIX
4-7
Building Stand-Alone Applications on UNIX
This section explains how to compile and link C or C++ source code into a
stand-alone UNIX application. This section includes
Configuring for C or C++ on page 4-7
Preparing to Compile on page 4-8
Verifying mbuild on page 4-11
Verifying the MATLAB Compiler on page 4-12
About the mbuild Script on page 4-13
Packaging UNIX Applications on page 4-13
Configuring for C or C++
The mbuild script deduces the type of files you are compiling by the file
extension. If you include both C and C++ files,
mbuild uses the C++ compiler
and the MATLAB C++ Math Library. If
mbuild cannot deduce from the file
extensions whether to compile C or C++,
mbuild invokes the C compiler. The
MATLAB Compiler generates only
.c and .cpp files. Table 4-1, UNIX File
Extensions for mbuild, shows the supported file extensions.
Note You can override the language choice that is determined from the
extension by using the
-lang option of mbuild. For more information about
this option, as well as all of the other
mbuild options, see the mbuild reference
page.
Table 4-1: UNIX File Extensions for mbuild
Language Extension(s)
C
.c
C++
.cpp
.C
.cxx
.cc