C Shared Library Integration
Integrate packaged MATLAB® functions into C applications
MATLAB Compiler SDK™ enables you to create C shared libraries from MATLAB functions.
Shared libraries that use the mxArray
API have an
interface that uses C-style functions to initialize the MATLAB Runtime, load the packaged MATLAB functions into the MATLAB Runtime, and manage data that is passed between the C code and the
MATLAB Runtime. For an example, see Create a C Shared Library with MATLAB Code.
Functions
compiler.build.cSharedLibrary | Create C shared library (Since R2021a) |
compiler.build.CSharedLibraryOptions | Options for building C shared libraries (Since R2021a) |
mbuild | Compile and link source files against MATLAB generated shared libraries |
C API
mclmcrInitialize | Initialize the MATLAB Runtime proxy library |
mclInitializeApplication | Set up application state shared by all MATLAB Runtime instances created in current process |
mclTerminateApplication | Close MATLAB Runtime-internal application state |
<library>Initialize[WithHandlers] | Initialize MATLAB Runtime instance associated with
|
<library>Terminate | Free all resources allocated by MATLAB Runtime instance associated with
|
mclRunMain | Mechanism for creating identical wrapper code across all platforms |
mclIsMCRInitialized | Determine if MATLAB Runtime has been properly initialized |
mclWaitForFiguresToDie | Enable deployed applications to process graphics events so that figure windows remain displayed |
mclGetLastErrorMessage | Last error message from unsuccessful library initialization or MATLAB function call |
mclGetLogFileName | Retrieve name of log file used by MATLAB Runtime |
mclIsJVMEnabled | Determine if MATLAB Runtime was started with instance of Java Virtual Machine (JVM) |
mclIsNoDisplaySet | Determine if -nodisplay mode is enabled |
Topics
Create and Implement a C Shared Library
- Create a C Shared Library with MATLAB Code
Learn how to create a C shared library.
Integrate a C Shared Library with a C Driver Application
- Call MATLAB Compiler SDK API Functions from C/C++
Use MATLAB Compiler SDK shared library functions in C and C++ code. - Use Multiple Shared Libraries in Single Application
Use multiple generated shared libraries in a single C/C++ application.
Troubleshooting C Shared Libraries
- Compilation Failures
List of possible failures during compilation. - Testing Failures
List of possible failures during testing. - Deployment Failures
List of possible failures during deployment. - Troubleshoot mbuild
Issues involving thembuild
utility and creating standalone applications.