MATLAB: How to create a shared library from a C file within MATLAB

MATLAB Compiler

I have a C-file called feefi.c and associated header file called feefi.h. I would like to create a shared library or object from this file.

Best Answer

To compile the C-file you will need the MATLAB Compiler. then perform the following steps:
1) Create a new EXPORTS file called 'foo.exports' that contains the names of all the functions.
2) Compile in MATLAB using:
mcc foo.c foo.exports
to create the shared library.