User`s guide
Building Stand-Alone Applications on PCs
4-17
Choosing a Compiler
Systems with Exactly One C/C++ Compiler. If the MATLAB Compiler and your
supported C or C++ compiler are installed on your system, you are ready to
create C or C++ stand-alone applications. On systems where there is exactly
one C or C++ compiler available to you, the
mbuild utility automatically
configures itself for the appropriate compiler. So, for many users, to create a C
or C++ stand-alone applications, you can simply enter
mbuild filename.c
This simple method works for the majority of users. Assuming filename.c
contains a
main function, this example uses your installed C or C++ compiler
as your default compiler for creating your stand-alone application. If you are a
user who does not need to change compilers, or you do not need to modify your
compiler options files, you can skip ahead in this section to “Verifying mbuild”
on page 4-22. If you need to know how to change the options file or select a
different compiler, continue with this section.
Note On Windows 98 systems, if you get the error, out of environment
space
, see “Out of Environment Space Running mex or mbuild” on page 4-33
for more information.
Systems with More than One C/C++ Compiler. On systems where there is more than
one C or C++ compiler, the
mbuild utility lets you select which of the compilers
you want to use. Once you choose your C or C++ compiler, that compiler
becomes your default compiler and you no longer have to select one when you
compile your stand-alone applications.
For example, if your system has both the Lcc and Microsoft Visual C/C++
compilers, when you enter for the first time
mbuild filename.c
you are asked to select which compiler to use:
Please choose your compiler for building stand-alone MATLAB
applications:
Select a compiler: