The error received is a linker error which indicates that the C++ source file that is being MEXed does not contain the MEX gateway function "mexFunction".
To create a MEX file using source code that is present in multiple source files, provide all the source files as input to the MEX function. For example, if you have the following source files:
fileContaininingMEXGateway.cpp
sourceFile1.cpp
sourcefile2.cpp
the MEX command to be used to create a a MEX file is shown below:
mex -v fileContaininingMEXGateway.cpp sourceFile1.cpp sourcefile2.cpp
Best Answer