User`s guide

2 Installation and Configuration
2-20
mex Verification
Choosing a Compiler
Systems with Exactly One C/C++ Compiler. If you have properly installed the
MATLAB Compiler and your supported C or C++ compiler, you can now create
C MEX-files. On systems where there is exactly one C or C++ compiler
available to you, the
mex utility automatically configures it se lf for the
appropriate compiler. So, for many users, to create a C MEX-file, you can
simply enter
mex filename.c
This simple method of creating MEX-files works for the majority of users. It
usesyourinstalledCorC++compiler asyourdefaultcompilerforcreatingyour
MEX-files.
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
“Creating MEX-Files” on page 2-23.
Note On Windows 95 and Windows 98 systems, if you get the error, out of
environment space
, see “Out of Environment Space Running mex or mbuild”
on page 2-26 for more information.
Systems with More than One C/C++ Compiler. Onsystemswherethereismorethan
one C or C+ + comp ile r , the
mex utility lets you select which of the compile rs 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
MEX-files.
For example, if your syst em has both t he Borland and Watcom co mp ile rs, when
you enter for the first time
mex filename.c
you are asked to select which compiler to use.
mex has detected the following compilers on your machine: