User`s guide

External Interfaces/API
23-29
MathWorks recommends that you recompile all MEX-files after installing MATLAB
7.1. MEX-files compiled in MATLAB 7.0.4 with .dll extensions should still work in
MATLAB 7.1.
There may be two MEX-files with the same name, except that one has a .mexw32
extension and the other has a .dll extension. When these files are both on the MATLAB
search path:
If the two files are in the same directory, MATLAB uses the .mexw32 file.
If the two files are in different directories, MATLAB uses the file in the directory that
is higher on the search path.
If you want one of these two files to take precedence over the other, ensure that the
directory that contains the file you want MATLAB to use is higher on the search path
than the directory that contains the file you do not want MATLAB to use.
Compatibility Considerations
Previous versions of MATLAB do not recognize MEX-files compiled in MATLAB 7.1 with
.mexw32 extensions. However, you can use the mex -output option in MATLAB 7.1 to
build a MEX-file with a .dll extension that earlier versions of MATLAB can recognize.
You may need to update any MATLAB scripts or makefiles that explicitly expect .dll
extensions for compiled MEX-files. You can use the mexext function in MATLAB to
obtain the extension for the platform and version you are working on. A new mexext
script obtains the appropriate extension when executed from outside MATLAB, as in a
makefile.
On Windows systems, MATLAB issues warnings at MEX setup time, compile time, and
run-time to notify you of possible incompatibilities resulting from the change in MEX-file
extension from .dll to .mexw32.
New mex–output Behavior for Compatibility
The -output option to mex specifies the filename of the compiled MEX-file. In general,
mex ignores any filename extension supplied in the -output argument and uses the
extension for the compiled file that is appropriate for the architecture. However, on
Windows systems, if the -output argument specifies a .dll extension, the compiled file
has this extension instead of .mexw32. Previous versions of MATLAB can recognize the
resulting compiled file.