
409Using Compiled Code
It’s really quite simple: Within our MEX le we should #include the library’s header
(e.g., “blas.h”), so that we could reference its functions and data types in our MEX code.
When the code is ready, add the library as a link parameter to the mex compilation com-
mand. For example, in the case of BLAS:*
mex -largeArrayDims mexFile.c -llibmwblas
MATLAB’s default library folder, %matlabroot%/extern/lib/… is already included in the
mex linker’s default path, so for any library in that folder (e.g., libmwblas.lib) we do not nor-
mally need to specify a full path when linking.
Integrating a third-party library, that is, one t