This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Troubleshoot MEX Files

Common errors creating and using MEX files


dbmexEnable MEX-file debugging on UNIX platforms
inmemNames of functions, MEX-files, classes in memory


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® software

Invalid MEX File Errors

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

Getting Help When MEX Fails

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 MEX API Incompatibilities

More information for warnings and error messages.

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.

MEX API Is Not Thread Safe

Do not call a single session of MATLAB on separate threads from a MEX file.

Was this topic helpful?