User`s guide

Building Stand-Alone Applications on UNIX
4-9
Locating Options Files
mbuild locates your options file by searching the following:
T he current directory
$HOME/.matlab/R12
<matlab>/bin
mbuild
uses the first occurrence of the options file it finds. If no options file is
found,
mbuild displays an error message.
Preparing to Compile
Note Refer to “Supported ANSI C and C++ UNIX Compilers” in Chapter 2
for information about supported co mp ile rs and important limitations.
Using the System Compiler
If the MATLAB Co mp ile r and your su ppor te d C or C++ co mp ile r are inst alle d
on your syst em, y ou are r ea d y to create C or C++ stand-alone ap p lica tio ns. To
create a stand-alone C applicat io n, you can s imp ly enter
mbuild filename.c
This simple method works for the majority of users. Assuming filename.c
contains a main function, this example uses the system’s compiler as your
default compiler for creating your stand-alone application. If you are a user
who does not need to change C or C++ 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-12. If you need to know how to change the options file or
select a different compiler, continue with this section.
Changing Compilers
Changing the Default Compiler. You need to use the setup option if you want to
change any op ti ons or link against different libra r ies . At the UNIX prompt type
mbuild -setup