User`s guide

2 Installation and Configuration
2-26
mex Works from Shell But Not from MATLAB (UNIX). If the command
mex -x yprime.c
works from the UNIX shell prompt but does not work from the MATLAB
prompt, you may have a problem with your
.cshrc file. When MATLAB
launches a new C shell to perform compilations, it executes the
.cshrc script.
If this script causes unexpected changes to the
PATH, an error may occur. You
can test whether this is true by performing a
set SHELL=/bin/sh
prior to launching MATLAB. If this works correctly, then you should check
your
.cshrc file for problems setting the PATH.
Cannot Locate Your Compiler (PC). If mex has difficulty locating your installed
compilers, it is useful to know how it goes about finding compilers.
mex
automatically detects your installed compilers by first searching for locations
specified in the following environment variables:
BORLAND for Borland C++ Compiler, Version 5.3
WATCOM for the Watcom C/C++ Compiler
MSVCDIR for Microsoft Visual C/C++, Version 5.0, 6.0, or 7.0
Next,
mex searches the Windows registry for compiler entries. Note that
Watcom does not add an entry to the registry. Digital Fortran does not use an
environment variable;
mex only looks for it in the registry.
Internal Error When Using mex -setup (PC). Some antivirus software packages such
as Cheyenne AntiVirus and Dr. Solomon may conflict with the
mex -setup
process. If you get an error message during
mex -setup of the following form
mex.bat: internal error in sub get_compiler_info(): don't
recognize <string>
then you need to disable your antivirus software temporarily and rerun
mex -setup. After you have successfully run the setup option, you can reenable
your antivirus software.
Verification of mex Fails. If none of the previous solutions addresses your
difficulty with
mex, contact Technical Support at The MathWorks at
support@mathworks.com.