Why do I receive the error "Mex file entry point is missing?"

6 views (last 30 days)
When I try to compile my foo.c, I receive an error like the following:
Mex file entry point is missing. Please check the (case-sensitive)
spelling of mexFunction (for C MEX-files), or the (case-insensitive)
spelling of MEXFUNCTION (for FORTRAN MEX-files).
??? Invalid MEX-file

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Nov 2018
This error is due to the fact that "mexFunction" or the parameters may be incorrect. Make sure you have:
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
In order to have a valid mex source code, the above function needs to replace "main()" with "void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )"
For more information, see:
Under "Examples of C MEX-files".

More Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!