This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Troubleshoot MEX Files

Common errors creating and using MEX files


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


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 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?