Documentation

Troubleshoot MEX Files

Common errors creating and using MEX files

Functions

dbmex Enable MEX-file debugging (on UNIX platforms)
inmem Names of functions, MEX-files, classes in memory
mex Build MEX function from C/C++ or Fortran source code
mexext Binary MEX file-name extension

Topics

Debug on Microsoft Windows Platforms

This example shows how to debug a MEX file with Microsoft®Visual Studio®.

Debug on Mac Platforms

This example shows how to debug a MEX file on Mac Platforms.

Debug on Linux Platforms

This example shows how to debug a MEX file on Linux®Platforms.

Debug Fortran Source MEX-Files

Debugging MEX-file source code from MATLAB®软件

Invalid MEX File Errors

What to do when you get an invalid MEX file error.

墨西哥人F时得到帮助ails

To help diagnose compiler set up and build errors, call the mex function with verbose option -v.

Compiling MEX File Fails

What to do when compiling a MEX file fails.

Symbol mexFunction Unresolved or Not Defined

Every MEX file needs a mexFunction.

MEX File Segmentation Fault

What to do when a MEX file causes a segmentation violation or assertion.

MEX File Generates Incorrect Results

What to do when your MEX generates wrong answers.

Platform Compatibility

If you get a binary MEX file from another source, be sure that the file was compiled for the same platform on which you want to run it.

Version Compatibility

For best results, run MEX files built with your MATLAB version.

Troubleshooting and Limitations Compiling C/C++ MEX Files with MinGW-w64

Troubleshooting MEX files built with the MinGW-w64 compiler.

MATLAB Supports Fortran 77

MATLAB supports MEX files written in Fortran 77.

Memory Management Issues

Rules for managing mxArray memory.

SDK "macosx10.8" cannot be located Error Message

Error message running a MEX file on Mac platforms.

Was this topic helpful?