External Interfaces/API    

Building MEX-Files

This section covers the following topics:

Compiler Requirements

Your installed version of MATLAB contains all the tools you need to work with the API. MATLAB includes a C compiler for the PC called Lcc, but does not include a Fortran compiler. If you choose to use your own C compiler, it must be an ANSI C compiler. Also, if you are working on a Microsoft Windows platform, your compiler must be able to create 32-bit windows dynamically linked libraries (DLLs).

MATLAB supports many compilers and provides preconfigured files, called options files, designed specifically for these compilers. The Options Files table lists all supported compilers and their corresponding options files. The purpose of supporting this large collection of compilers is to provide you with the flexibility to use the tool of your choice. However, in many cases, you simply can use the provided Lcc compiler with your C code to produce your applications.

The MathWorks also maintains a list of compilers supported by MATLAB at the following location on the web: http://www.mathworks.com/support/tech-notes/v5/1600/1601.shtml.

The following sections contain configuration information for creating MEX-files on UNIX and Windows systems. More detailed information about the mex script is provided in Custom Building MEX-Files. In addition, there is a section on Troubleshooting, if you are having difficulties creating MEX-files.


  Using Data Types Testing Your Configuration on UNIX