User`s guide

Microsoft Windows on PCs
2-19
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 itself 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
uses your installed C or C++ compiler as your default compiler for creating your
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-22.
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 2-25
for more information.
Systems with More than One C/C++ Compiler. On systems where there is more than
one C or C++ compiler, the
mex 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
MEX-files.
For example, if your system has both the Borland and Watcom compilers, 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: