For more information, see MEX Platform Compatibility.
When you build object files into a MEX function, make sure they are built with the same version of the C or Fortran Matrix API.
This error occurs when you compile two or more files independently with the
-c
compile-only option, then try to build them into a MEX
function. For example:
mex -c function1.c -largeArrayDims mex -c function2.c -R2018a mex function1.o function2.o
This error occurs when you compile a file with the -c
compile-only option and then link with a version of the API that is incompatible.
For example, if you use the following commands to build a MEX file, then the
function errors at runtime.
mex -c function1.c -largeArrayDims mex function1.o -R2018a
If you create a C++ MEX file using functions in the MATLAB Data API, then the following build command errors.
mex function.cpp -R2017b
Use this command instead.
mex function.cpp
MATLAB® does not find a version number in the MEX file. The MEX file uses functions in an API that requires a version number. For more information, see https://www.mathworks.com/matlabcentral/answers/377799-compiling-mex-files-without-the-mex-command.
Your source code is compatible with the interleaved complex API. For best results,
replace the mex
-largeArrayDims
build option with the -R2018a
option.
For more information, see Typed Data Access in C MEX Files.
For more information, see Upgrade MEX Files to Use 64-Bit API.
For more information, see MEX Platform Compatibility.
For more information, see MEX Version Compatibility.